Does Lazarus Suuport transparency with PNG lazarus / 39-Graphics ---------------------------------------------------------------------- BenJones · 2013-05-09 05:01 Hi, I was wondering does lazarus support the saving of Transparent png files. I tryed loading in a Bitmap with the transparent color set at RGB 255,0,255, the png file saves but no transparency. any ideas of how to get around this? Here is a sniplet of code I use maybe you guys can see if I gone wrong anywere. Thanks Code: [Select]var   png : TPortableNetworkGraphic;   bmp : TBitmap; begin   png := TPortableNetworkGraphic.Create;   bmp := TBitmap.Create;   bmp.LoadFromFile('c:\out\ben.bmp');   png.PixelFormat := pf32bit;   png.Transparent := True;   png.TransparentColor := RGBToColor(255,0,255);   png.Assign(bmp);   png.SaveToFile('c:\out\hello.png'); ---------------------------------------------------------------------- User137 · 2013-05-09 07:19 That didn't seem to work, but changing it a little did: Code: [Select]var   png : TPortableNetworkGraphic;   bmp : TBitmap; begin   png := TPortableNetworkGraphic.Create;   png.PixelFormat := pf32bit;   bmp := TBitmap.Create;   bmp.PixelFormat := pf32bit;   bmp.Transparent := True;   bmp.TransparentColor := RGBToColor(255,0,255);   bmp.LoadFromFile('d:\netti\temp.bmp');   png.SetSize(bmp.Width, bmp.Height);   png.Canvas.Draw(0, 0, bmp);   png.SaveToFile('d:\netti\temp.png');   bmp.Free;   png.Free;I got rid of assign(), and made the bmp transparent instead. ---------------------------------------------------------------------- Dibo · 2013-05-09 11:03 Try with BGRABitmap. It has full support for PNG. http://wiki.freepascal.org/BGRABitmap ---------------------------------------------------------------------- BenJones · 2013-05-09 19:24 Thanks User137 seems to work that now. Dibo I also take a look at BGRABitmap thanks agian.