public static void Clear() { Graphics g = Graphics.FromImage(Mybitmap); g.Clear(Color.White); Mypanel.Invalidate(); }
public static void DrawRectangle(int width, int height) { Graphics g = Graphics.FromImage(Mybitmap); g.DrawRectangle(new Pen(Color.Black, penT), xPos, yPos, width, height); Mypanel.Invalidate(); }
public static void DrawCircle(int radius) { Graphics g = Graphics.FromImage(Mybitmap); g.DrawEllipse(new Pen(Color.Aqua, penT), xPos, yPos, radius, radius); Mypanel.Invalidate(); }
public static void DrawPen(int x, int y) { Graphics g = Graphics.FromImage(Mybitmap); g.DrawLine(new Pen(Color.Purple, penT), new Point(xPos, yPos), new Point(x, y)); PenPosition(x, y); Mypanel.Invalidate(); }
public static void DrawTriangle(int firstSide, int secondSide) { Point[] triPoints = new Point[3]; triPoints[0] = new Point(xPos, yPos); triPoints[1] = new Point(firstSide + xPos, firstSide + yPos); triPoints[2] = new Point(triPoints[1].X - secondSide, triPoints[1].Y); Graphics g = Graphics.FromImage(Mybitmap); g.DrawPolygon(new Pen(Color.Red, penT), triPoints); Mypanel.Invalidate(); }