Thread Rating:
  • 8 Vote(s) - 2.13 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB] The PNG (Portable Network Graphics) Class
#1
The PNG (Portable Network Graphics) Class
Version: 1.0˃
Based upon work by Elroy of VBForums (June 22, 2022)


Introduction

Permits the loading of standard RGBA type (32bpp).PNG graphics  into a  Visual Basic 6 environment.  Due to their similarities with the format, both .TIF and TIFF graphics files are also usable.

The code has been cleaned up since its original iteration, and provides a more detailed error message system if issues arise.  It also bypasses a false positive error  with certain png files  based on their color indexing.  This false error had halt class processing, now resolved.


Features
  • Supports loading of .png files within the Visual Basic 6 environment.
  • Supports .tif / .tiff images due to format similarities.
  • Able to define image opacity and scaling on .png file load.
  • Transparent background support
  • An updated error message system in the event issues arise.
  • Easy to use method/command.


Limitations
  • Does not adapt/update the default LoadPicture command, but uses its own.
  • LoadPNG (the command/method) does not have palette nor custom size definition properties.


Code
Code
Or within the actual Class_PNG.cls format:
.zip   Class_Png.zip (Size: 6.35 KB / Downloads: 3)


Instructions
Plenty... in the code itself.


FAQ
The original code was not in the forum of a class, but as a basic module. It has since been streamlined while the error message system upgraded.


Credits and Thanks
Thanks to Elroy of VBForums who wrote the base code in 2022


Terms and Conditions
Use as you see fit. No requirements other than due credit for both Elroy and myself.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [VB] The MCISendString Multimedia Class DerVVulfman 0 168 01-03-2026, 06:46 PM
Last Post: DerVVulfman



Users browsing this thread: 2 Guest(s)