Re: load a png file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Mike D Sutton (EDais_at_mvps.org)
Date: 11/26/04


Date: Fri, 26 Nov 2004 23:09:10 -0000


> What is the best way to open up a PNG file in a PictureBox with a picturebox
> or with a CommonDialogBox.
> I would like to do it without any fancy DLL, Classes or OCX type controls .
> Can you help me, please

It's not a complete solution, however the PNGInfo class on my site demonstrates how to grab the image data from a .PNG file, and the
ZLib article demonstrates how to use the compression library used by the format so it would be a fairly simply task to meld the two
together into something that reads the image data out. Your other option is to look at GDI+ which IIRC has native support for the
image .PNG format, either method requires an additional DLL but since VB can't compile in the ZLib library to it's own executable
you will have to use some DLL file that includes the libraries code.
Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://EDais.mvps.org/



Relevant Pages

  • Re: [opensuse] tall PNG images dont load in Firefox
    ... knowing the correct idiom to use with one or other of the X libraries, ... since gimp et al handle things correctly. ... know which libraries are used by the failing applications but perhaps ... I doubt too many people run into such a monstorous .png file. ...
    (SuSE)
  • Re: Image file in C
    ... > I dont want to use any libraries. ... and libpng. ... which probably has descriptions of the png file ... > But i want to know the struct of the matrix. ...
    (comp.lang.c)
  • Setting transparent colour of image
    ... I've got a byte array containing some image data, and I am writing it to ... the web browser on the fly as a PNG file. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: load a png file
    ... > What is the best way to open up a PNG file in a PictureBox with a ... > picturebox or with a CommonDialogBox. ... > I would like to do it without any fancy DLL, Classes or OCX type controls ...
    (microsoft.public.vb.general.discussion)
  • load a png file
    ... What is the best way to open up a PNG file in a PictureBox with a picturebox ... or with a CommonDialogBox. ... I would like to do it without any fancy DLL, Classes or OCX type controls. ...
    (microsoft.public.vb.general.discussion)