This is a
really simple basic screen capture utility that needs no API calls. It captures
the whole screen and then you can either save it into a file or show it (draw it
actually) on the form.
'First, two global variables are declared to load a capture into a bitmap.
Dim bm As Bitmap
'The following is a capture function. A screen copy is made and assigned to a
pointer.This is all that is needed to make an image copy of the screen.
Private Sub btCapture(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click.
Dim gr As Graphics
bm = New Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, Drawing.Imaging.PixelFormat.Format32bppArgb)
gr = Graphics.FromImage(bm)
gr.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
Screen.PrimaryScreen.Bounds.Y, 0, 0, NewSize(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height))
End Sub
'You may choose to view the captured image. Note the use of the WindowState property.
chandana sPosted Mar 31, 2014, 7:14 AM
copyfromscreen() funciton not working after hosting in asp.net website. what is the postive alternative to take screen shot of div alone in a particular web page. Kindly help me sir