Results 1 to 14 of 14

Thread: Basic VB6 PNG Compiler

Threaded View

  1. #11
    Fanatic Member
    Join Date
    Aug 2013
    Posts
    806

    Re: Basic VB6 PNG Compiler

    LaVolpe's answer above is excellent and comprehensive for GDI+. You'd be hard-pressed to find a cleaner solution that avoids the use of 3rd-party libraries.

    If you don't mind 3rd-party libraries, the open-source FreeImage library provides excellent 16-bit grayscale support:

    http://freeimage.sourceforge.net/

    FreeImage includes a comprehensive VB6 module, and using the DLL from VB is simple. To create a 16-bit grayscale image, you basically do the following:

    - Allocate a new 16-bit grayscale image at the same dimensions as your image
    - Use CopyMemory to copy the bits of your displacement map over the bits of the allocated image. (FreeImage uses the same 4-byte alignment rule as Windows, so CopyMemory works without issue.)
    - Save the completed image as a 16-bit PNG, TIFF, or any other format you can think up.
    Last edited by Tanner_H; Dec 13th, 2014 at 10:29 PM. Reason: Fix link
    Check out PhotoDemon, a pro-grade photo editor written completely in VB6. (Full source available at GitHub.)

Tags for this Thread

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