我有一个简单的程序,您可以使用 FillEllipse 和 FillRectangle 在屏幕上绘制。我的问题是,当您将另一个窗口拖动到屏幕的一小部分时,该部分将被删除。当您将另一个窗口拖过,放开,然后将其拖回时,就会发生这种情况。有没有什么办法解决这一问题?
Dim MyFormObject As Graphics = Me.CreateGraphics
Select Case shape
Case "Ellipse"
MyFormObject.FillEllipse(brush, e.X - CInt(brushWidth / 2), e.Y - CInt(brushHeight / 2), brushWidth, brushHeight)
Case "Rectangle"
MyFormObject.FillRectangle(brush, e.X - CInt(brushWidth / 2), e.Y - CInt(brushHeight / 2), brushWidth, brushHeight)
End Select
您可以在窗体上放置一个 PictureBox 控件并绘制到该控件上,当其他窗口在其上绘制时,它不会被删除:
在 form_load 或其他东西上执行一次:
pictureBox1.Image = new Bitmap(Width, Height);
to draw:
Graphics.FromImage(pictureBox1.Image).FillRectangle(Brushes.Black, 0, 0, 100, 100);
pictureBox1.Refresh();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)