本文介绍了跨线程图片盒pointtoscreen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Using bitmap As New Bitmap(CameraView.Width, CameraView.Height)
Using g As Graphics = Graphics.FromImage(bitmap)
' Get the paramters to call g.CopyFromScreen and get the image
Dim rectanglePanelVideoPreview As Rectangle = CameraView.Bounds
Dim sourcePoints As System.Drawing.Point = CameraView.PointToScreen(New System.Drawing.Point(CameraView.ClientRectangle.X, CameraView.ClientRectangle.Y))
g.CopyFromScreen(sourcePoints, System.Drawing.Point.Empty, rectanglePanelVideoPreview.Size)
End Using
End Using
i希望使用backgroundworker来执行该代码,但因使用PointToScreen而出现错误。
请帮我重新编写跨线程代码。 Thx
i want to use backgroundworker to do that code, but got error because use PointToScreen.
Please help me re-code with cross-thread. Thx
推荐答案
If Me.InvokeRequired Then
Me.Invoke(New MethodInvoker(AddressOf AccessControl))
Else
查看此链接了解更多信息:
[]
祝你好运!
Check this link for more info:
http://msdn.microsoft.com/en-us/library/ms171728%28v=vs.85%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1[^]
Good luck!
这篇关于跨线程图片盒pointtoscreen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!