| View previous topic :: View next topic |
| Author |
Message |
perro
Joined: 28 Aug 2008 Posts: 3
|
Posted: Thu Aug 28, 2008 12:49 pm Post subject: Copy screenshot into PictureBox |
|
|
How to print screen and import it into PictureBox?
Private Sub Print_Click...
SendKeys.Send("^{PRTSC}")
System.Threading.Thread.Sleep(200)
PictureBox.Image = Clipboard.GetImage()
PictureBox.Refresh()
End Sub
First time I click the button nothing appears. Second time I push the button screenshot of screen appears like it was first time I pushed the button, and so on...
If I divide my code into 2 parts, and push 2 buttons one after another everything works fine. What to do? |
|
| Back to top |
|
 |
|
|
chubzyko 50+ Club

Joined: 30 Jul 2008 Posts: 97 Location: Marikina City, Philippines
|
Posted: Thu Aug 28, 2008 6:43 pm Post subject: Re: Copy screenshot into PictureBox |
|
|
haiya perro! i just created this print screen capture! if you click the capture button, it will capture the entire screen. and there's also a save button wherein it will be save in your c: as a jpg file. btw, there's a picturebox in the form but i made the visible to false. but you can edit it if you want the picture box to be visible.
here's the link where you can download it.
http://ijustdontcare.net76.net/ |
|
| Back to top |
|
 |
chubzyko 50+ Club

Joined: 30 Jul 2008 Posts: 97 Location: Marikina City, Philippines
|
Posted: Thu Aug 28, 2008 6:44 pm Post subject: Re: Copy screenshot into PictureBox |
|
|
| just download the capture.zip file. and plz dont try to see my other personal files there. |
|
| Back to top |
|
 |
perro
Joined: 28 Aug 2008 Posts: 3
|
Posted: Fri Aug 29, 2008 12:28 pm Post subject: Re: Copy screenshot into PictureBox |
|
|
I've downloaded it, thanks.
First I tried with VB6.0, and got it, but application didn't work on PC with only VB6Runtime. Therefore I tried with VB .NET. But I still can't figure out why this works with two buttons, and with one... |
|
| Back to top |
|
 |
chubzyko 50+ Club

Joined: 30 Jul 2008 Posts: 97 Location: Marikina City, Philippines
|
Posted: Fri Aug 29, 2008 4:46 pm Post subject: Re: Copy screenshot into PictureBox |
|
|
| hmn? what do you mean? |
|
| Back to top |
|
 |
perro
Joined: 28 Aug 2008 Posts: 3
|
Posted: Fri Sep 05, 2008 2:22 pm Post subject: Re: Copy screenshot into PictureBox |
|
|
Never mind... Handled it...
Problem was that SendKeys instruction sends PRTSC only after event has finished. Therefore, copying clipboard into picturebox allways handled screen shot which was taken the last time the event was activated. |
|
| Back to top |
|
 |
|