Screen capture

P

Per

Hi all,
This may be a newbie question, but I can't find the answer anywhere.
I want to make a capture of the screen, or a part of the screen, that
contains the main portion of the form.
Detecting the screen that contain the main portion of the form is pretty
straight forward, but how do I capture what I need in an Image object?
Another thing, how do you make the program move the mouse pointer and
simulate clicks?

Best regards
 
J

José Joye

To capture the complete screen:


Public Shared Function CaptureScreen() As Bitmap

Dim strKeys As String = "^{PRTSC}"
SendKeys.SendWait(strKeys)
Dim iData As IDataObject = Clipboard.GetDataObject()
If (iData.GetDataPresent(DataFormats.Bitmap)) Then
Dim memoryImage As New
Bitmap(CType(iData.GetData("System.Drawing.Bitmap"), Bitmap))
Return memoryImage
End If

'-- Unable to obtain screenShot from clipboard
Return Nothing
End Function


- José
 
G

Guest

Hi Per,

To move the mouse pointer and simulate clicks you can use SendInput function
(Win32 function).

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top