Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
521 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

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

Accepted Solution

by:
CodeCruiser earned 2000 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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

963 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