Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Copy screenshot into PictureBox



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Visual Basic Forum
View previous topic :: View next topic  
Author Message
perro



Joined: 28 Aug 2008
Posts: 3

PostPosted: Thu Aug 28, 2008 12:49 pm    Post subject: Copy screenshot into PictureBox Reply with quote

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
View user's profile Send private message
chubzyko
50+ Club


Joined: 30 Jul 2008
Posts: 97
Location: Marikina City, Philippines

PostPosted: Thu Aug 28, 2008 6:43 pm    Post subject: Re: Copy screenshot into PictureBox Reply with quote

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
View user's profile Send private message Visit poster's website
chubzyko
50+ Club


Joined: 30 Jul 2008
Posts: 97
Location: Marikina City, Philippines

PostPosted: Thu Aug 28, 2008 6:44 pm    Post subject: Re: Copy screenshot into PictureBox Reply with quote

just download the capture.zip file. and plz dont try to see my other personal files there.
Back to top
View user's profile Send private message Visit poster's website
perro



Joined: 28 Aug 2008
Posts: 3

PostPosted: Fri Aug 29, 2008 12:28 pm    Post subject: Re: Copy screenshot into PictureBox Reply with quote

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
View user's profile Send private message
chubzyko
50+ Club


Joined: 30 Jul 2008
Posts: 97
Location: Marikina City, Philippines

PostPosted: Fri Aug 29, 2008 4:46 pm    Post subject: Re: Copy screenshot into PictureBox Reply with quote

hmn? what do you mean?
Back to top
View user's profile Send private message Visit poster's website
perro



Joined: 28 Aug 2008
Posts: 3

PostPosted: Fri Sep 05, 2008 2:22 pm    Post subject: Re: Copy screenshot into PictureBox Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Visual Basic Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap