Hello everybody. These day, I'm working on PAM to integrate it in my launcher (ASuite) as new menu and I conceived to add png support. Therefore I'm looking for a component to read png files.
I found this component: ImageFileLib ( https://sourceforge.net/projects/imagefilelib/ ), released under no license (public domain?). I tried to convert a png to bmp and load it in a TImage component. It seem works fine.
I used this simple code (in form's event create):
procedure TForm1.FormCreate(Sender: TObject); var PNG :TPNGGraphic; BMP :TBitmap; begin BMP :=TBitmap.Create; PNG :=TPNGGraphic.Create; try PNG.LoadFromFile('xyz.png'); BMP.Assign(PNG); Image1.Picture.Bitmap := BMP; finally BMP.Free; PNG.Free; end; end;
The license in the readme states: "This source code may be used in freeware products and free source distributions either in the original or modified form. I only require that my name is mentioned in the program (e.g. in the about box) or documentation. The library may not be used in commercial products without permission from the author (send an e-mail with short description of the application). See JasPerLib\jasper-1.700.2\license for license information regarding the included JasPer library."
Due to it's non-commercial requirement, it is not compatible with the GPL or LGPL and can not be compiled or linked to GPLed or LGPLed code.
That's one of a few PNG libraries I found... none of which meet the criteria for an OSI-approved license (thus, they're not really open source).
Sometimes, the impossible can become possible, if you're awesome!
Sourceforge is supposed to host only OSI licensed software, I guess someone will have to tell the admins at sourceforge about this so they shut down that project.
--
Anyways, the official libpng is OSI approved.
The license in the readme states: "This source code may be used in freeware products and free source distributions either in the original or modified form. I only require that my name is mentioned in the program (e.g. in the about box) or documentation. The library may not be used in commercial products without permission from the author (send an e-mail with short description of the application). See JasPerLib\jasper-1.700.2\license for license information regarding the included JasPer library."
D'oh. I didn't read readme. In project page on sourceforge there is this:
License: (None Listed)
I will continue to seek, but maybe I will waste time.
Ah John, in PAM I convert imgBackground's image from bmp to jpeg and PAM's exe make small: from 1400KB to 750KB about.
I found another component. Unfortunately it needs lpng.dll to work.
Download link: http://www.salvadorsoftware.com/download/lpngDelphi.zip
License: I downloaded this component (and dll) from The Pythian Project, a GPL software. Anyway units and dll uses zlib/libpng license (it is compatible with the GPL).
Code example to convert png to bmp and use it in a TImage component:
Would this allow for per-pixel transparency?
someone with more knowledge of the licensing stuff is on the hunt.
How about this
http://freeimage.sourceforge.net
Says it supports PNG, Delphi, and is released under GPL or FIPL which ever works better for the developer.
"Because they stand on a wall and say, 'Nothing is going to hurt you tonight. Not on my watch.'" (A Few Good Men)
Coincidence is God's way of remaining anonymous.(Albert Einstein)