tags:

views:

421

answers:

3

One of Delphi 2009's advertised features was PNG support. That's great, because the Unicode issues break the pngimage.pas library I was using before. Only problem is, I can't find the Delphi 2009 version. Anyone know what it's called, and how difficult it is to migrate existing pngimage.pas-based code to the new library?

+1  A: 

You can read png images into a TImage control. Just like gif, jpg, emf, wmf, bmp.

Not sure if that's what you want.

Gamecat
No. I'm not looking for anything VCL-related. I'm trying to load them into a game engine with its own blitter. D2009 broke my PNG library and I can't find the replacement it says it provides, and that bugs me.
Mason Wheeler
Just so someone won't misinterpret your comment here, my guess is that your subsequent acceptance of Nick's answer means that D2009 does indeed have the PNG support you expected.
Argalatyr
Yeah. He also pointed out where to find the base PNG library that's not dependent on the VCL.
Mason Wheeler
+7  A: 

All VCL image support in Delphi is provided via TImage. If you want to display a PNG image, simply drop a TImage control and then load a PNG image into the Picture property.

If you want to manipulate a PNG image in code (i.e., not display it) then you can add

pngimage

to your uses clause, and then use the TPNGImage class directly.

On my machine, PNGImage.pas is found at:

C:\Program Files\CodeGear\RAD Studio\6.0\source\Win32\vcl\Imaging\PNGImage\pngimage.pas

Nick Hodges
you beat me to the punch nick! i was answering your e-mail! :-) mp
X-Ray
also TImageList supports PNG, you can load Png images into it, and use it in Toolbar or other controls.
Mohammed Nasman
A: 

Thank you, Nick, your solution really helps a lot.

Unfortunately the Delphi 2009 Professional help files are so bad that you seldom get any answers at all. Even if you search for pngimage you won't get any result.