跪求!!跪求!!VB picturebox Graphics.FromImage 对象正在使用的问题
两个Picturebox 对应两个副线程,只运行一个picturebox ,或者两个一起用的话,偶尔会出现Graphics.FromImage,正在使用的错误,System.InvalidOperationException: 对象当前正在其他地方使用。
在 System.Drawing.Graphics.FromImage(Image image)
Private Sub BgDrawPicturebox2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BgDrawPicturebox2.DoWork
PictureBox2.Refresh()
Dim g3 As Graphics
Dim bmp3 As Bitmap
bmp3 = New Bitmap(470, 240)
PictureBox2.Image = bmp3
g3 = Graphics.FromImage(PictureBox2.Image)
DrawOrdinate2(g3, 1, 5, 35, 220, 435, 20)
DrawaxisValue2(g3)
Drawtarget2(1, g3)
g3.Dispose()
System.Threading.Thread.Sleep(300)
End Sub
在 System.Drawing.Graphics.FromImage(Image image)
Private Sub BgDrawPicturebox2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BgDrawPicturebox2.DoWork
PictureBox2.Refresh()
Dim g3 As Graphics
Dim bmp3 As Bitmap
bmp3 = New Bitmap(470, 240)
PictureBox2.Image = bmp3
g3 = Graphics.FromImage(PictureBox2.Image)
DrawOrdinate2(g3, 1, 5, 35, 220, 435, 20)
DrawaxisValue2(g3)
Drawtarget2(1, g3)
g3.Dispose()
System.Threading.Thread.Sleep(300)
End Sub
...全文
相关推荐
vb.net使用picturebox绘图
例如:```vbDim g As Graphics = pictureBox1.CreateGraphics()```然后,你可以使用Graphics对象的方法来绘制图形。
VB用PICTUREBOX 控件制作实时曲线
**绘图基础**: - VB6提供了`Graphics`对象,我们可以通过PICTUREBOX的`PaintPicture`方法或直接使用`CreateGraphics`方法来获取这个对象,用于在PICTUREBOX
VB6实现PictureBox图片快速90度旋转处理
在完成旋转后,我们使用`BitBlt`函数将旋转后的图像复制回PictureBox。
VB Picturebox亮度调节方法
在VB中,可以使用GDI+(Graphics Device Interface Plus)库来实现图像处理。GDI+提供了丰富的图形绘制和处理功能,包括对图像的读取、显示以及修改像素等操作。
vb 条形码在picturebox内生成,并打印
至此,我们就完成了在VB中使用PictureBox生成并打印条形码的过程。需要注意的是,实际应用中可能需要根据具体需求调整条形码的大小、位置、字体样式等,以及处理打印预览和多页打印等问题。


