tôi có mã này mà vẽ một hình chữ nhật (Im cố gắng để làm lại MS Paint)vòng tròn Vẽ với System.Drawing
case "Rectangle":
if (tempDraw != null)
{
tempDraw = (Bitmap)snapshot.Clone();
Graphics g = Graphics.FromImage(tempDraw);
Pen myPen = new Pen(foreColor, lineWidth);
g.DrawRectangle(myPen, x1, y1, x2-x1, y2-y1);
myPen.Dispose();
e.Graphics.DrawImageUnscaled(tempDraw, 0, 0);
g.Dispose();
}
Nhưng nếu tôi muốn vẽ một vòng tròn, những gì sẽ thay đổi?
g.DrawRectangle(myPen, x1, y1, x2-x1, y2-y1);
trao cho bạn câu trả lời – Tony