|
-
Feb 14th, 2003, 08:15 AM
#1
Thread Starter
Sleep mode
Screen shot ![Resolved]
How can I take a screen shot in VB.NET?
Last edited by Pirate; Feb 14th, 2003 at 12:37 PM.
-
Feb 14th, 2003, 08:42 AM
#2
Hyperactive Member
PRINTSCREEN
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 14th, 2003, 08:44 AM
#3
Hyperactive Member
VB Code:
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()
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 14th, 2003, 12:23 PM
#4
Thread Starter
Sleep mode
What does this symbol mean (%) ???
-
Feb 14th, 2003, 12:36 PM
#5
Thread Starter
Sleep mode
It did it !
thanx for your help
-
Feb 14th, 2003, 12:37 PM
#6
Hyperactive Member
Re: Screen shot !
Originally posted by Pirate
How can I take a screen shot in VB.NET?
... or use SnagIt!
-
Feb 14th, 2003, 12:40 PM
#7
Thread Starter
Sleep mode
no I just need to include this feature into my proj!
-
Feb 14th, 2003, 02:41 PM
#8
Hyperactive Member
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
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 14th, 2003, 03:49 PM
#9
Thread Starter
Sleep mode
As I got this , it's like a shortcut key .If so , that would be great because I wanted to create a shortcut key !
-
Feb 14th, 2003, 08:48 PM
#10
umm any better way besides pressing the print key?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:01 PM
#11
Thread Starter
Sleep mode
-
Feb 14th, 2003, 09:02 PM
#12
Thread Starter
Sleep mode
-
Feb 14th, 2003, 09:03 PM
#13
Originally posted by Pirate
I mean hotkeys
oh hotkeys
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:03 PM
#14
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:05 PM
#15
Thread Starter
Sleep mode
Originally posted by MrPolite
umm any better way besides pressing the print key?
It's another way than Print key
-
Feb 14th, 2003, 09:06 PM
#16
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
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:09 PM
#17
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
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:10 PM
#18
Thread Starter
Sleep mode
I just like this way .Very easy to use .I got very complicated API code but it's very very complicated .
-
Feb 14th, 2003, 09:11 PM
#19
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
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 14th, 2003, 09:15 PM
#20
Thread Starter
Sleep mode
sorry I can't now .....lol
-
Feb 14th, 2003, 10:25 PM
#21
PowerPoster
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.
-
Feb 15th, 2003, 08:57 AM
#22
Thread Starter
Sleep mode
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 .
-
Feb 15th, 2003, 09:34 AM
#23
Thread Starter
Sleep mode
hellswraith , How can I save the screen shot directly to bitmap ??Is this possible ?
-
Mar 6th, 2003, 10:53 AM
#24
Frenzied Member
this saves the image to my clipboard...how do I print?
Code:
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|