Results 1 to 10 of 10

Thread: [vb6] FreeImage DLL.

  1. #1

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    [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.

  2. #2
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148

    Re: [vb6] FreeImage DLL.

    There is a VB Wrapper in the 3.8 download and an example.
    Dazzer

  3. #3

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Re: [vb6] FreeImage DLL.

    Yes, quite so. Do you have any idea as to how to use it for my goal?

  4. #4
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148

    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
    Dazzer

  5. #5

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    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.

  6. #6
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148

    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.
    Dazzer

  7. #7

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    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?

  8. #8
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148

    Re: [vb6] FreeImage DLL.

    Have a look at this googled thread.

    Link
    Dazzer

  9. #9
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Re: [vb6] FreeImage DLL.

    http://vbfx.yhoko.com/common/getdibits/

    From my 'general programming' section...
    Last edited by Fox; Jul 14th, 2011 at 08:51 AM.

  10. #10
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,238

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width