tags:

views:

1698

answers:

3

How can one open a PNG formatted image file with VB6? Ideally, I (that is my customer) would like to have the PNG file open and placed into seperate R(ed), G(reen) and B(lue) arrays.

VB6 is not my tool of choice (for lack of knowledge) and I be thrilled if some one could point me in the right direction for a VB6 solution.

A: 

Thanks for the link, although not being a fluent VB guy (more C & ASM flavours), the code appears to be very BMP centric; not PNG.

If that's the case, I have to believe you suggested the link because it would be a simple matter to make the code PNG'able, but I wouldn't know how to approach that.

Jamie
+5  A: 

Not many know that you can use GDI+ in VB 6 by using the right declaration. GDI+ has a much richer API for dealing with bitmaps including PNG files and breaking it down into it's component RGB values. GDI+ is what underlies the graphics capabilities of the .NET framework. IN short with declaration of GDI+ functions you can give VB6 much of the same functionality as the new .NET graphics framework.

This article is an example

http://www.vbaccelerator.com/home/Vb/Code/vbMedia/Using_GDI_Plus/Reading_and_Writing_JPG__PNG__TIF_and_GIF_Files/article.asp

Do a Google search for VB6 GDI+ along with another search for GDI+ PNG. Between the two search you should be able to find the article(s) that tell what you need to do.

RS Conley
A: 

You could try the open source FreeImage project.

MarkJ