|
-
Dec 13th, 2014, 10:25 PM
#11
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
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|