Click to See Complete Forum and Search --> : ScreenShot
stever2003
Mar 3rd, 2001, 10:53 PM
How do I get my computer's screenshot and put it into a PictureBox control? Also, how can I save the screenshot with the GIF or JPEG format?
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_SNAPSHOT = &H2C
Private Function SaveScreen(ByVal theFile As String) As Boolean
On Error Resume Next
'To get the Entire Screen
Call keybd_event(VK_SNAPSHOT, 1, 0, 0)
'To get the Active Window
'Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), theFile
SaveScreen = True
Exit Function
End Function
Usage
Call SaveScreen("C:\Windows\Desktop\screenshot1.bmp")
Than after you save the picture, you can use the LoadPicture function to load it into the Picturebox.
Picture1.Picture = LoadPicture("C:\Windows\Desktop\screenshot1.bmp")
stever2003
Mar 4th, 2001, 04:07 PM
Yeah I've seen that thread before but i'm wondering if i can put the screenshot directly into an PictureBox. Also, can I save it as a GIF or JPEG?
pramod kumar
Mar 4th, 2001, 08:12 PM
If u wto convert bmp to jpg u need some dll (i think some were it available)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.