Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images and the clipboard, CF_HDROP, null characters

Status
Not open for further replies.

siu01jam

Programmer
Oct 2, 2003
12
GB
I have been trying to copy an image to the windows clipboard and then paste it to a canvas on my form. It is working with BMP images but I also want it to work for JPEGs. I have an algorithm that can convert from JPG to BMP.

When I copy a JPG file, I found out that the type of data stored in the clipboard is "text/uri" which I think is the address of the image. The clipboard format is CF_HDROP which I found out is an array of characters storing a series of strings, each string terminated by the null character and the final string terminated by a double null character.

I am trying to get this text from the clipboard using Clipboard.AsText but I only get an empty string. I assume this is because there is a null charater terminating it, rather than a double null specifying the end of the character array. How can I get the full array of characters thereby getting the address of the image?

I got the CF_HDROP info from:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top