我有一段绘制矩形的代码(我正在尝试重新制作 MS Paint)。
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();
}
但是如果我想画一个圆圈,会有什么变化吗?
g.DrawRectangle(myPen, x1, y1, x2-x1, y2-y1);