By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

Screen capture

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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ť
"Per" <no****@nospam.com> wrote in message
news:1S******************@news2.e.nsc.no...
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

Nov 16 '05 #2

P: n/a
Hi Per,

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

Regards,

"Per" wrote:
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

Nov 16 '05 #3

P: n/a
Per
Thanks alot Josť, this code was a great help:-)

Per
"Josť Joye" <jo**********************@bluewin.ch> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
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ť
"Per" <no****@nospam.com> wrote in message
news:1S******************@news2.e.nsc.no...
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


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.