picturebox问题
我在picturebox里画图,每0.5秒画一次,怎么图片老是闪烁呢?
备注:数组是变化的
'根据数组画图
Private Sub drawELS(ByVal x As Integer, ByVal y As Integer, ByVal s As Integer, ByVal z As Integer, ByVal a As Integer)
Dim picGraphics As System.Drawing.Graphics
Dim gr As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim sizeFK1 As Integer = 30
picGraphics = Graphics.FromImage(gr)
Dim i As Integer, j As Integer
Dim x1, y1 As Integer
For i = 0 To 18
For j = 1 To 12
If myFK.elsFKsuzu2(i, j) + myFK.elsFKsuzu(i, j) = 1 Then
x1 = (j - 1) * 30
y1 = i * 30
picGraphics.FillRectangle(myBrush, New Rectangle(x1, y1, sizeFK1, sizeFK1))
picGraphics.DrawLine(myFK.myFKforeC, x1, y1, x1 + sizeFK1, y1)
picGraphics.DrawLine(myFK.myFKforeC, x1 + sizeFK1, y1, x1 + sizeFK1, y1 + sizeFK1)
picGraphics.DrawLine(myFK.myFKforeC, x1, y1, x1, y1 + sizeFK1)
picGraphics.DrawLine(myFK.myFKforeC, x1, y1 + sizeFK1, x1 + sizeFK1, y1 + sizeFK1)
End If
Next
Next
Dim gg As Graphics
gg = PictureBox1.CreateGraphics
gg.Clear(Color.Black)
gg.SmoothingMode = Drawing2D.SmoothingMode.Default
gg.DrawImage(gr, 0, 0)
myBrush.Dispose()
picGraphics.Dispose()
End Sub备注:数组是变化的
...全文
相关推荐
c# winform listView鼠标拖拽到pictureBox问题的解决办法,鼠标拖动
当用户希望实现从ListView中通过鼠标拖拽来移动数据到PictureBox时,可能会遇到一些挑战。这个问题主要涉及到Windows Forms的事件处理和数据传输机制。
纯C#-pictureBox 画ROI抠图源码,本人测试可用,有问题欢迎咨询解答
该项目实现了基于C# Windows Forms的图像ROI选取功能,用户可通过鼠标在PictureBox中绘制矩形区域,支持实时显示选区并进行交互操作。代码结合PaddleOCRSharp库,为后续
Pocket PC Picturebox上面透明label的实现
需要注意的是,这种方法依赖于底层 GDI+ 绘图,可能会存在性能问题,尤其是在大量或者频繁更新文本时。在实际应用中,应根据具体需求和设备性能进行优化。
C# 动态加载pictureBox
在实际项目中,你可能还需要考虑性能优化、图片加载进度提示、错误处理等问题,以实现更加健壮和用户友好的应用。
c# 鼠标在窗体PictureBox上的十字光标定位
- 如果图像较大,转换坐标和绘制操作可能会有性能问题,这时可以考虑使用双缓冲技术来提高流畅性。


