Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLEDragDrop GetData() in BMP/WAV format?
Message
From
24/05/2005 16:55:21
 
 
To
24/05/2005 16:05:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01016102
Message ID:
01017282
Views:
40
Hi Christian,

> Just want to throw in that this is buggy ..

>
> #define CF_DIB 8
> if oDataObject.GetFormat( 2 )
>    lcData = oDataObject.GetData( CF_DIB )
>    strtofile( lcData, "myimage.dib" )
>    this.picture = "myimage.dib"
> endif
>
Unfortunately you can't use the raw DIB (BITMAPINFO) structure that GetData( CF_DIB ) returns like your snippet illustrates.

Fortunately Herman Tan just posted code that parses the raw DIB info returned by GetData() and adds the header necessary to convert the DIB content into a fully formed BMP file.

Unfortunately (do I sound like a soap opera? hope that translates) Office apps appear to convert their images to a 256 color palette when filling the oDataObject with DIB data.

There may be other image formats present when GetFormat( CF_BITMAP ) is True (metafile and enhanced metafile formats?) I'm going to see how Office transfers data in these formats - hopefully without loss of color resolution!

> only because the Dataobject contains data of type CF_BITMAP doesn't neccessarily mean that there's also data of type CF_DIB .. Word puts images in both formats into the dataobject .. but that doesn't have to be true for other applications .., it's up to the application you're dragging from if there is CF_DIB data, CF_BITMAP or both.

Excellent point. I will add error handling code to my solution to make sure that the expected information is present.

Thanks for your suggestions!

Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform