public override void Draw(DrawParams param) { using (Pen pen = OutlineStyle.CreatePen(param)) { param.Graphics.DrawLine(pen, X1, Y1, X2, Y2); } }
public override void Draw(DrawParams param) { using (Brush brush = FillStyle.CreateBrush(param)) { param.Graphics.FillRectangle(brush, Math.Min(X1, X2), Math.Min(Y1, Y2), Width, Height); } using (Pen pen = OutlineStyle.CreatePen(param)) { param.Graphics.DrawRectangle(pen, Math.Min(X1, X2), Math.Min(Y1, Y2), Width, Height); } }
public override void Draw(DrawParams param) { PointF[] points = new PointF[3]; points[0] = new PointF(X1, Y1); points[1] = new PointF(X2, Y2); points[2] = new PointF(X3, Y3); using (Brush brush = FillStyle.CreateBrush(param)) { param.Graphics.FillPolygon(brush, points); } using (Pen pen = OutlineStyle.CreatePen(param)) { param.Graphics.DrawPolygon(pen, points); } }
public override void Draw(DrawParams param) { PointF[] points = new PointF[Points.Length]; for (int i = 0; i < Points.Length; i++) { points[i] = new PointF(Points[i].X, Points[i].Y); } using (Brush brush = FillStyle.CreateBrush(param)) { param.Graphics.FillPolygon(brush, points); } using (Pen pen = OutlineStyle.CreatePen(param)) { param.Graphics.DrawPolygon(pen, points); } }
protected Drawable() { OutlineStyle = new OutlineStyle(Color.Black, 0, System.Drawing.Drawing2D.DashStyle.Solid); FillStyle = new FillStyle(); }