Click to See Complete Forum and Search --> : Screen shot ![Resolved]
Pirate
Feb 14th, 2003, 07:15 AM
How can I take a screen shot in VB.NET?
phrozeman
Feb 14th, 2003, 07:42 AM
PRINTSCREEN :D
phrozeman
Feb 14th, 2003, 07:44 AM
Public Function GetScreenCapture( _
Optional ByVal FullScreen As Boolean = False) As Image
' Captures the current screen and returns as an Image
' object
Dim objSK As SendKeys
Dim imgCapture As Image
If FullScreen = True Then
' Print Screen pressed twice here as some systems
' grab active window "accidentally" on first run
objSK.SendWait("{PRTSC 2}")
Else
objSK.SendWait("%{PRTSC}")
End If
Dim objData As IDataObject = Clipboard.GetDataObject()
Return objData.GetData(DataFormats.Bitmap)
End Function
'USAGE
GetScreenCapture(True).Save("c:\screengrab.bmp")
PictureBox1.Image = GetScreenCapture()
Pirate
Feb 14th, 2003, 11:23 AM
What does this symbol mean (%) ???
Pirate
Feb 14th, 2003, 11:36 AM
It did it !
thanx for your help
RealNickyDude
Feb 14th, 2003, 11:37 AM
Originally posted by Pirate
How can I take a screen shot in VB.NET? ... or use SnagIt! :p
Pirate
Feb 14th, 2003, 11:40 AM
:D no I just need to include this feature into my proj!;)
phrozeman
Feb 14th, 2003, 01:41 PM
Originally posted by Pirate
What does this symbol mean (%) ???
That's used to make an screenshot from the current window... it's the same when u press ALT+PRINTSCREEN
Pirate
Feb 14th, 2003, 02:49 PM
As I got this , it's like a shortcut key .If so , that would be great because I wanted to create a shortcut key !
MrPolite
Feb 14th, 2003, 07:48 PM
umm any better way besides pressing the print key?
Pirate
Feb 14th, 2003, 08:01 PM
shortcut keys !
Pirate
Feb 14th, 2003, 08:02 PM
I mean hotkeys
MrPolite
Feb 14th, 2003, 08:03 PM
Originally posted by Pirate
I mean hotkeys oh hotkeys
MrPolite
Feb 14th, 2003, 08:03 PM
what about them
Pirate
Feb 14th, 2003, 08:05 PM
Originally posted by MrPolite
umm any better way besides pressing the print key?
It's another way than Print key
MrPolite
Feb 14th, 2003, 08:06 PM
Originally posted by Pirate
It's another way than Print key eeh? my question was is there any way NOT to clear the clipboard by doing this? anyways this is not a proper way of getting a screenshot. I guess there's a way using APIs, I can't remember
MrPolite
Feb 14th, 2003, 08:09 PM
Originally posted by phrozeman
That's used to make an screenshot from the current window... it's the same when u press ALT+PRINTSCREEN is there any ENUM that has all the values of the keys? it feels a little awkward this way
Pirate
Feb 14th, 2003, 08:10 PM
I just like this way .Very easy to use .I got very complicated API code but it's very very complicated .
MrPolite
Feb 14th, 2003, 08:11 PM
Originally posted by Pirate
I just like this way .Very easy to use .I got very complicated API code but it's very very complicated . err it's ok, post it :)
Pirate
Feb 14th, 2003, 08:15 PM
sorry I can't now .....lol:D :D
hellswraith
Feb 14th, 2003, 09:25 PM
Originally posted by MrPolite
eeh? my question was is there any way NOT to clear the clipboard by doing this? anyways this is not a proper way of getting a screenshot. I guess there's a way using APIs, I can't remember
Sure, you save the clipboard contents to a variable first, then get the screenshot, then bring it into another bitmap variable. Now just restore the old content back to the clipboard, it happens so quick that it is like it never happened.
Pirate
Feb 15th, 2003, 07:57 AM
Originally posted by hellswraith
Sure, you save the clipboard contents to a variable first, then get the screenshot, then bring it into another bitmap variable. Now just restore the old content back to the clipboard, it happens so quick that it is like it never happened.
Storing it to Clipboard , makes some delay .I will try your way now :D .
Pirate
Feb 15th, 2003, 08:34 AM
hellswraith , How can I save the screen shot directly to bitmap ??Is this possible ?
:rolleyes:
EyeTalion
Mar 6th, 2003, 09:53 AM
this saves the image to my clipboard...how do I print?
Public Function GetScreenCapture( _
Optional ByVal FullScreen As Boolean = False) As Image
' Captures the current screen and returns as an Image
' object
Dim objSK As SendKeys
Dim imgCapture As Image
If FullScreen = True Then
' Print Screen pressed twice here as some systems
' grab active window "accidentally" on first run
objSK.SendWait("{PRTSC 2}")
Else
objSK.SendWait("%{PRTSC}")
End If
Dim objData As IDataObject = Clipboard.GetDataObject()
Return objData.GetData(DataFormats.Bitmap)
End Function
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.