Re: screenshot taker help
Which line causes an error? Check what's in your Label1.Text. I think that the filename you try to save the screen to has illegal characters or empty. I checked with this:
vb Code:
screenGrab.Save("C:\test.jpeg")
and it worked as charm.
Re: screenshot taker help
nope still get the same issue wit screengrab.save problem
Re: screenshot taker help
I can confirm this works for me as well, even with 2 monitors.
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(0, 0), ScreenSize)
screenGrab.Save("C:\file.jpeg")
Re: screenshot taker help
Quote:
Originally Posted by
xx_lol_xx
nope still get the same issue wit screengrab.save problem
My guess is you don't have permission to write to the folder on "C:\", in Win7 I usually use one of the public folders to save images when testing code.
Also it is a good idea to set the image format in the .Save call, in VB10/WinXP just calling screenGrab.Save("c:\file.jpeg") actually saved the image as a PNG type on my system.
Re: screenshot taker help
Your right edgemeal, although i found it out for myself it was the problem. I didnt have permission. Which is strange because I haven't had windows 7 long but on xp it allows me to create files in their.
Thanks for your help.