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
504 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
 

Author Comment

by:Dov_B
ID: 34209227
nothing appears in my form or picturebox
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now