VB.net Clipboard problem.

Joined
Feb 12, 2007
Messages
7
Programming Experience
1-3
Hi all I have a simple question. I want a way of determining if Jpeg of GIF pics are in the clip board. VB.net allows us this to us for Bitmaps but how can I determine or get data from clip board of type Jpeg of GIF. Thanx in advance for your help.
 
Thanx for the reply once again. Can you kindly tell me as to how to check for jpeg images on Clipboard? then read it on to the picture box.

Kindly give a small example.
 
I have an application which can see a bitmap on the clipboard, but i have tried lots of methods to find out if it is a jpg or gif but they always return "memoryBMP" or "BMP" format.
 
I haven't even tested this so don't shhot the messenger...

VB.NET:
if  Directcast(Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap)), 
Bitmap).RawFormat.Equals(system.drawing.imaging.Imageformat.Jpeg) then
 
...
 
end if

A really long shot. But try that until i can figure out how to read the header of file on the clipboard.
 
Looking into it further it may just be that the only way to do it is to load the image into a bitmap object and then determine the format. It seems the clipboard's predefined formats don't extend to image formats.
 
Back
Top