[RESOLVED] [2005] Screenshot on coordinates...
How can i make a screenshot at some specified coordinates, a rectangle coordinates?
I want to make a screensot only to a part of the screen.
Code:
Dim ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
g.CopyFromScreen(New Point(0, 0), New Point(100, 100), ScreenSize)
'screenGrab.Save("C:\screenGrab.bmp")
screenGrab.Save("C:\screenGrab.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
I have tried with this code but it's not working as i need. The rest of the screen it's black...
Re: [2005] Screenshot on coordinates...
in your .copyfromscreen instruction, you're specifying to copy the whole screen to a bitmap. the upperleftdestination point is 100, 100.
so the first 100 pixels to the left + the first 100 pixels at the top are black, and the screen image is cropped. am i right?
which part of the screen do you want to copy?
Re: [2005] Screenshot on coordinates...
Yes you are right... this is a sample that i founded on the forums... and it's not what i desire!
I want to make a screenshot at the top of the screen on the left side for about 100 pixels, a rectangle...
How can i do this ?!
Re: [2005] Screenshot on coordinates...
g.CopyFromScreen(New Point(0, 0), New Point(0, 0), new Size(100, 100))
Re: [2005] Screenshot on coordinates...
i forgot to mention
Dim screenGrab As New Bitmap(100, 100)
Re: [2005] Screenshot on coordinates...
You're the man... ;)
Thanks alot for the help!