Taking screenshot

GuruMadMat

New member
Joined
Mar 11, 2005
Messages
2
Programming Experience
3-5
I would like to take a screenshot from an object in my form
My form consist of a browser and I want what is viewable in browser save in an jpg or bmp file and stored on pc
i'v looked in google but they always take full screenshot etc....


thnx GuruMadMat
 
this might be of some use or whatnot, this module (rename the file to *.vb, instead of *.txt then add the *.vb file to your app) captures the whole form (like what vb6's button magic did) and prints it, some of the code in there may be of use for what you're trying to accomplish
 
so if your webbrowser is WebBrowser1
use this
Clipboard.SetDataObject(TakeScreenShot(Me.WebBrowser1), 2)
Here is the TakeScreenShot Function
Private Function TakeScreenShot(ByVal Control As Control) As Bitmap
On Error Resume Next
Dim Screenshot As New Bitmap(Control.Width, Control.Height, Imaging.PixelFormat.Format24bppRgb)
Control.DrawToBitmap(Screenshot, New Rectangle(0, 0, Control.Width + 8, Control.Height + 8))
Return Screenshot
End Function
 
Back
Top