示例#1
0
        void DrawCanvas()
        {
            if (canvas == null)
            {
                return;
            }
            var updates = new List <Rectangle>();

            canvas.GraphDefaults(updates);
            canvas.SetColor(handler.Foreground);

            canvas.SetLineStyle(BGICanvas.LineStyle.User, this.LinePattern, 1);

            canvas.Line(20, 20, 108, 20, updates);
            canvas.Line(20, 20, 108, 64, updates);
            canvas.Line(20, 20, 108, 108, updates);
            canvas.Line(20, 20, 64, 108, updates);
            canvas.Line(20, 20, 20, 108, updates);

            canvas.SetLineStyle(BGICanvas.LineStyle.User, this.LinePattern, 3);

            canvas.Line(236, 20, 148, 20, updates);
            canvas.Line(236, 20, 148, 64, updates);
            canvas.Line(236, 20, 148, 108, updates);
            canvas.Line(236, 20, 192, 108, updates);
            canvas.Line(236, 20, 236, 108, updates);

            canvas.Control.Invalidate();
        }
示例#2
0
        void DrawCanvas()
        {
            if (canvas == null)
            {
                return;
            }
            var updates = new List <Rectangle> ();

            canvas.GraphDefaults(updates);
            canvas.SetFillPattern(FillPattern, handler.Background);
            canvas.Bar(new Rectangle(canvas.WindowSize), updates);
            canvas.Control.Invalidate();
        }
示例#3
0
        void DrawCanvas()
        {
            var updates = new List <Rectangle>();

            canvas.GraphDefaults(updates);
            canvas.SetTextStyle(handler.FontType, handler.TextDirection, handler.FontSize);
            var font = canvas.LoadFont(handler.FontType);
            var str  = "AaBb";
            var size = font.GetRealTextSize(str, handler.TextDirection, handler.FontSize);

            size       = (canvas.WindowSize - size) / 2;
            size.Width = Math.Max(size.Width, 0);
            canvas.OutTextXY(size.Width, size.Height, str, updates);
            canvas.Control.Invalidate();
        }
示例#4
0
        void DrawPreview()
        {
            if (canvas == null)
            {
                return;
            }
            var updates = new List <Rectangle>();

            canvas.GraphDefaults(updates);
            canvas.SetTextStyle(SelectedFont, handler.TextDirection, fontSize);
            var font = canvas.LoadFont(SelectedFont);
            var str  = "The quick brown Fox Jumps over the lazy dog";
            var size = font.GetRealTextSize(str, handler.TextDirection, fontSize);

            size       = (canvas.WindowSize - size) / 2;
            size.Width = Math.Max(size.Width, 0);
            canvas.OutTextXY(size.Width, size.Height, str, updates);

            canvas.Control.Invalidate();
        }