How to make a 32bits PNG image without transparency lazarus / 39-Graphics ---------------------------------------------------------------------- phabyam · 2012-11-16 05:43 Hola amigos! I need to generate a 32bits png image without transparent pixels, I'm doing this Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   Png : TPortableNetworkGraphic; begin   Png := TPortableNetworkGraphic.Create;   Png.PixelFormat:=pf32bit;   Png.Transparent:=False;   //Png.TransparentColor:=clNone;   Png.SetSize(256,256);   Png.Canvas.Brush.Color:=clBlue;   Png.Canvas.FillRect(0,0,256,256);   Png.Canvas.Brush.Color:=clYellow;   Png.Canvas.Ellipse(10,10,246,246);   Png.SaveToFile('E:\Archivos\Escritorio\DrawTest.png');   Png.Free; end;  but the saved image have transparent pixels, check this http://i.imgur.com/75MmE.png  when I change   Png.PixelFormat:=pf32bit; to pf24bits the saved image is OK , check this http://i.imgur.com/hDqX8.png, but unfortunately I need the image in 32bits pixel format Helpme guys, sorry my poor english ---------------------------------------------------------------------- Imants · 2012-11-16 07:09 try something like this   lazimg := TLazIntfImage.Create(256, 256);   drawer := TLazCanvas.create(lazimg);   drawer.Rectangle(0, 0, 255, 255);   FStream := TFileStream.Create('C:\test.png', fmOpenWrite);   FWrite := TFPWriterPNG.create;   FWrite.UseAlpha := False;   FWrite.WordSized := False;   lazimg.SaveToStream(FStream, FWrite);    drawer.Free;   FStream .Free;   FWrite.Free;   lazimg.Free; ---------------------------------------------------------------------- circular · 2012-11-16 07:43 What do you mean by 32 bits ? If it's RGB each 8 bits, then it means that there is an implicit alpha channel. So you need to fill it with zeroes for example with something like "for each pixel, get color, change alpha color to zero and set color"