【发布时间】:2012-10-11 09:59:22
【问题描述】:
我尝试编写一个简单的图形编辑器。我有下一个问题,当我使用SolidBrush() 绘制一些曲线时,我得到了中断的曲线(看图片)。我需要获得不间断的曲线。我尝试为此使用鼠标捕获,但它不起作用(结果相同)。我该如何解决?查看以下 MouseMove 事件处理程序的代码:
void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown)
{
pictureBox1.Capture = true; // I try to capture mouse here
Graphics g = Graphics.FromHwnd(this.pictureBox1.Handle);
g.FillRectangle(new SolidBrush(Color.Black), e.X, e.Y, 1, 1);
}
}
【问题讨论】: