问题描述
我用vb2005编了一个小程序,其中用到Graphics.FillEllipse方法,但在运行过程中用Graphics.FillEllipse方法产生的图形在当前窗口会消失,即没有更换窗口,谁能告诉我为什么,谢谢。
解决方案
解决方案二:
看看代码
解决方案三:
要写在Paint事件中。否则只要窗体被重绘,上面已绘制的东西都会消失。
解决方案四:
试试这个代码:ProtectedOverridesSubOnPaint(ByValeAsPaintEventArgs)DimredBrushAsNewSolidBrush(Color.Red)DimxAsSingle=0.0FDimyAsSingle=0.0FDimwidthAsSingle=200.0FDimheightAsSingle=100.0Fe.Graphics.FillEllipse(redBrush,x,y,width,height)EndSub
解决方案五:
dimBasnewbitmap(me.width,me.height)usinggasgraphics=graphics.fromimage(b)画画endusingme.backgroundimage=B
解决方案六:
引用2楼caozhy的回复:
要写在Paint事件中。否则只要窗体被重绘,上面已绘制的东西都会消失。
版主帮我看看,这段代码吧,也是画图的问题.http://bbs.csdn.net/topics/390708385
时间: 2024-08-02 20:45:02