【发布时间】:2020-04-04 00:01:55
【问题描述】:
我有这段代码可以绘制一个矩形(我正在尝试重新制作 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);
【问题讨论】: