-
[vb6] FreeImage DLL.
I'd like to use the FreeImage Dll (http://freeimage.sourceforge.net/) to gather the contents of a Device Context and convert them (presumably to png, as it has good compression) into a format that I can send using winsock or directx. The documentation on that subject is a little cryptic, has anyone used this dll before? Thanks.
-
Re: [vb6] FreeImage DLL.
There is a VB Wrapper in the 3.8 download and an example.
-
Re: [vb6] FreeImage DLL.
Yes, quite so. Do you have any idea as to how to use it for my goal?
-
Re: [vb6] FreeImage DLL.
Yes.
Step 1. Get bitmap from DC
Step2. FreeImage_DIB_From_BMP (to get DIB)
Step3. FreeImage_Save FIF_PNG ,DIB,Filname
Step4. FreeImage_Unload DIB
-
Re: [vb6] FreeImage DLL.
Ok, how do I get a bitmap from a DC? And how do I convert that dib into a one dimensional array that I can send?
I need this to be in as little steps as possible, so saving to disk and then opening that for binary is out of the question, it'll take too much time. Thanks.
-
Re: [vb6] FreeImage DLL.
To get a bitmap from a DC:
Create a memory DC
Create a Bitmap the same size as the source
Select the bitmap onto the DC
bitblit from your DC to the newly created memory DC
Now you can use something like GetDIBBits to move your created bitmap into a 2D array.
-
Re: [vb6] FreeImage DLL.
Okay, can you please explain how GetDIBBits works? I think I remember it returning something like a long, so would that mean the data is stored somewhere in memory? If so, how do I retreive the data?
-
Re: [vb6] FreeImage DLL.
Have a look at this googled thread.
Link
-
Re: [vb6] FreeImage DLL.
http://vbfx.yhoko.com/common/getdibits/
From my 'general programming' section...
-
Re: [vb6] FreeImage DLL.
Can someone please write me a wrapper OCX or activex DLL that will encompass all of the functions, properties, and events of the freeimage.dll file? I have found some that encompass SOME of its functionality for free, or ALL of its functionality for a price. So maybe someone here can write one for me for free that will "wrap" ALL of freeimage.dll for me. Permitting an intuative implementation on my part for working all kinds of cool image processing in the program I'm working on.