Solved

how do I paste an image into a picturebox at runtime then progromaticly save the picture to file vb.net

Posted on 2010-11-24
9
509 Views
Last Modified: 2012-05-10
how do I paste an image into a picturebox at runtime then progromaticly save the picture to file vb.net
0
Comment
Question by:Dov_B
  • 4
  • 4
9 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 34209152
Do you mean paste from the clipboard?
0
 

Author Comment

by:Dov_B
ID: 34209178
yes and I have tried googling and  I did
PictureBox1.Image = Clipboard.GetImage
and it does not show anything pasted
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 500 total points
ID: 34209199
Try this

if Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap) Then
    pictureBox1.Image = Ctype(Clipboard.GetDataObject().GetData(DataFormats.Bitmap), Bitmap)
End If
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Dov_B
ID: 34209227
nothing appears in my form or picturebox
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34209249
What happens when you paste into Paint? Also step through the code to see if the condition is true or false
0
 

Author Comment

by:Dov_B
ID: 34209307
when I paste into paint.net it pastes
when I paste into paint it does not paste
when I paste into my vb app it does not paste

however doing what you told me made me realize that it wont copy images from my  myPictures folders directly but if I copy the picture into paint.net then copy it from paint.net it does go into my program

so I guess that leaves me with my last question now that I pasted it successfuly into my app how do I save it to file?
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 500 total points
ID: 34209418
0
 

Author Closing Comment

by:Dov_B
ID: 34209597
thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34211450
Glad to help :-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with converting xml file to excel using VB.NET 3 30
ASP/VB email question 4 59
vb.net Configuration, settings file location? 8 41
Need help with another query 10 34
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question