Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 7, load PNG to TImage

Just want to load a .PNG, tried with my LoadPic() using OleGraphic that works with other formats, but it failed on PNG.

The goal is to copy the image to a hidden bitmap whence it is then masked and copied to a visible working image canvas. Feel free to suggest something else if CopyRect doesn't do this.

But the main question: Load PNG. How? I've found a lot of pages (f.ex. TPNGImage), but all the resources and links on the web are dead, gone or not downloadable.

like image 674
Henrik Erlandsson Avatar asked Nov 29 '22 03:11

Henrik Erlandsson


2 Answers

Delphi 7 doesn't support PNG natively. There are several third party components that will let you add that support. For example, on Torry's site.

like image 125
Bruce McGee Avatar answered Dec 04 '22 21:12

Bruce McGee


Recent versions of Delphi support PNG natively, amongst many other enhancements, and you would be well advised to upgrade.

like image 35
David Heffernan Avatar answered Dec 04 '22 22:12

David Heffernan