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
496 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
Comment Utility
Do you mean paste from the clipboard?
0
 

Author Comment

by:Dov_B
Comment Utility
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
Comment Utility
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
Comment Utility
nothing appears in my form or picturebox
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Closing Comment

by:Dov_B
Comment Utility
thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Glad to help :-)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

18 Experts available now in Live!

Get 1:1 Help Now