Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get PNGs to work in D2009?

Tags:

png

delphi

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?

like image 565
Mason Wheeler Avatar asked Oct 31 '08 21:10

Mason Wheeler


1 Answers

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

like image 78
Nick Hodges Avatar answered Sep 29 '22 09:09

Nick Hodges