Example #1
0
        public override void print(DrawArea drawArea, Graphics g, int j, bool border)
        {
            try
            {
                StrAv       = false;
                WhichObject = false;
                StringFormat sf = new StringFormat();
                sf.LineAlignment = StringAlignment.Center;
                sf.FormatFlags   = StringFormatFlags.FitBlackBox;

                base.print(drawArea, g, j, border);
                if (N2S)
                {
                    int           a   = Convert.ToInt32(Text) + j;
                    number2String nss = new number2String();
                    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                    g.DrawString(nss.num2str(a.ToString()), new Font(FontName, FontSize, Style), new SolidBrush(FontColor), new Rectangle(X, Y, Width, Height));
                }
                //else if (Reversed)
                //{
                //    DrawReverse(g);
                //}
                //else if (Mirror1)
                //{
                //    DrawMirror(g, j);
                //}
                //else if (Mirror2)
                //{
                //    DrawMirror2(g);
                //}
                else
                {
                    int a     = Convert.ToInt32(Text) + j;
                    int total = ZeroNumber + Text.Length;
                    g.DrawString(string.Format("{0:D" + total + "}", Convert.ToInt32(a))
                                 , new Font(FontName, FontSize, Style), new SolidBrush(FontColor),
                                 X, Y);
                }
            }
            catch { }
        }
Example #2
0
        public override void Draw(DrawArea drawArea, System.Drawing.Graphics g, float zoom)
        {
            try
            {
                int different = Convert.ToInt32(drawArea.ZoomFactor);
                StrAv       = false;
                WhichObject = false;
                StringFormat sf = new StringFormat();
                sf.LineAlignment = StringAlignment.Center;
                sf.FormatFlags   = StringFormatFlags.FitBlackBox;
                base.Draw(drawArea, g, zoom);
                if (N2S)
                {
                    number2String nss = new number2String();

                    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                    g.DrawString(nss.num2str(Text), new Font(FontName, FontSize, Style), new SolidBrush(FontColor), new Rectangle(X, Y, Width, Height));
                }
                //else if (Reversed)
                //{
                //    DrawReverse(g);
                //}
                //else if (Mirror1)
                //{
                //    DrawMirror(g,0);
                //}
                //else if (Mirror2)
                //{
                //    DrawMirror2(g);
                //}
                else
                {
                    int total = ZeroNumber + Text.Length;
                    g.DrawString(string.Format("{0:D" + total + "}", Convert.ToInt32(Text))
                                 , new Font(FontName, FontSize, Style), new SolidBrush(FontColor),
                                 new Rectangle(X, Y, Width * different, Height * different));
                }
            }
            catch { }
        }