本文介绍了CreateGraphics问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 picInfo是我在鼠标移动时写入的PictureBox。下面是一段 的代码片段。 文字在屏幕上闪烁,但不会停留在那里。 任何人都知道为什么? 第二个问题.-我需要处理g吗? 第三个问题 - 看起来像Image应该参考某事。 如何在我设置为Nothing后发生 ........ snip picInfo.Visible = True picInfo.Location = InfoLoc picInfo.Image = Nothing''清除图像 Dim g As Graphics = picInfo.CreateGraphics g.DrawString(" Start X ="& CStr(mMarqueeStartPoint.X),New Font(" Arial" ,8), 新的SolidBrush(Color.Black),0,0) g.DrawString(" Start Y ="& CStr (mMarqueeStartPoint.Y),New Font(Arial,8), 新SolidBrush(Color.Black),0,10) 。 ....... snip End Sub picInfo is a PictureBox that I write into when the mouse moves. Below is asnip of the code. The text flashes on the screen but does not stay there. Anyone know why? Second question.- Do I need to dispose of g? Third question - Seems like Image should refer to something. How doesthat happen after I set it to Nothing ........snip picInfo.Visible = TruepicInfo.Location = InfoLoc picInfo.Image = Nothing ''Clear the image Dim g As Graphics = picInfo.CreateGraphics g.DrawString("Start X =" & CStr(mMarqueeStartPoint.X), New Font("Arial", 8),New SolidBrush(Color.Black), 0, 0) g.DrawString("Start Y=" & CStr(mMarqueeStartPoint.Y), New Font("Arial", 8),New SolidBrush(Color.Black), 0, 10) ........snip End Sub推荐答案 ?!? 它不会将它设置为''Nothing'后,请参阅任何内容。 - Herfried K. Wagner [MVP] < http://www.mvps.org/dotnet> ?!? It doesn''t refer to anything after setting it to ''Nothing''. --Herfried K. Wagner [MVP]<http://www.mvps.org/dotnet> 这篇关于CreateGraphics问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 14:09