Beispiel #1
0
        public override void Draw(Graphics gr)
        {
            // While this clips the region, the lines are no longer antialiased.

            /*
             * GraphicsPath gp = new GraphicsPath();
             * gp.AddPolygon(path);
             * Region region = new Region(gp);
             * gr.SetClip(region, CombineMode.Replace);
             * gr.IntersectClip(DisplayRectangle);
             * ...
             * gr.ResetClip();
             */

            // Drawing onto a bitmap that constrains the drawing area fixes the trail problem
            // but still has issues with larger pen widths (try 10) as triangle points are clipped.
            Rectangle r      = DisplayRectangle.Grow(2);
            Bitmap    bitmap = new Bitmap(r.Width, r.Height);
            Graphics  g2     = Graphics.FromImage(bitmap);

            g2.SmoothingMode = SmoothingMode.AntiAlias;
            Point[] path = ZPath();
            g2.FillPolygon(FillBrush, path);
            g2.DrawPolygon(BorderPen, path);
            gr.DrawImage(bitmap, DisplayRectangle.X, DisplayRectangle.Y);
            bitmap.Dispose();
            g2.Dispose();
            base.Draw(gr);
        }
Beispiel #2
0
        public override void Draw(Graphics gr)
        {
            base.Draw(gr);
            Rectangle r = DisplayRectangle.Grow(-4);

            control.Location             = r.Location;
            control.Size                 = r.Size;
            control.Text                 = Text;
            control.Font                 = TextFont;
            ((TextBox)control).Multiline = Multiline;
        }
Beispiel #3
0
        public override void Draw(Graphics gr)
        {
            base.Draw(gr);
            Rectangle r = DisplayRectangle.Grow(-4);

            control.Location = r.Location;
            control.Size     = r.Size;
            control.Text     = Text;
            control.Enabled  = Enabled;
            control.Visible  = Visible;
        }
Beispiel #4
0
 protected virtual void DrawTag(Graphics gr)
 {
     if (FillBrush.Color.ToArgb() == tagPen.Color.ToArgb())
     {
         Rectangle r = DisplayRectangle.Grow(-2);
         gr.DrawRectangle(altTagPen, r);
     }
     else
     {
         Rectangle r = DisplayRectangle.Grow(-2);
         gr.DrawRectangle(tagPen, r);
     }
 }
Beispiel #5
0
        public override void Draw(Graphics gr)
        {
            base.Draw(gr);
            Rectangle r = DisplayRectangle.Grow(-4);

            ((TrackBar)control).Minimum = Minimum;
            ((TrackBar)control).Maximum = Maximum;
            control.Location            = r.Location;
            control.Size    = r.Size;
            control.Text    = Text;
            control.Enabled = Enabled;
            control.Visible = Visible;
        }
Beispiel #6
0
        public override void Draw(Graphics gr)
        {
            Rectangle r      = DisplayRectangle.Grow(2);
            Bitmap    bitmap = new Bitmap(r.Width, r.Height);
            Graphics  g2     = Graphics.FromImage(bitmap);

            g2.SmoothingMode = SmoothingMode.AntiAlias;
            Point[] path = ZPath();
            g2.FillPolygon(FillBrush, path);
            g2.DrawPolygon(BorderPen, path);
            gr.DrawImage(bitmap, DisplayRectangle.X, DisplayRectangle.Y);
            bitmap.Dispose();
            g2.Dispose();
            base.Draw(gr);
        }