Hi,
I am working on a project using VB.net (I am quite new for VB.net worked mostly on VB6) and my object is to make a application by which I can start and stop a Machine. Its a Product Testing machine and operator is testing the product, and a graphics is running on that machine, I've to capture that running graphical object from machine and show it in my application using vb.net.
Please help me....Thanks in advance.
Regds.
RK
Loading
Hirendra SisodiyaPosted Mar 23, 2010, 1:27 AM
Hello Rahul
You can take a screen shot in your entire running window and easily can show in picturebox control. try this code
Dim hBitmap As Bitmap = Nothing
Dim g As Graphics = Me.CreateGraphics()
Try
Dim sz As Size = Me.Size
hBitmap = New Bitmap(sz.Width, sz.Height, g)
Dim hGraphics As Graphics = Graphics.FromImage(hBitmap)
hGraphics.CopyFromScreen(Me.Location.X, Me.Location.Y, 0, 0, sz)
Catch
If (Not g Is Nothing) Then g.Dispose()
Finally
If (Not g Is Nothing) Then g.Dispose()
End Try
PictureBox1.Image = hBitmap
thanks
please mark as answere if you like my answere