Hello to all,
I'm trying to get the color depth of a loaded png with TImage.
I created with gimp sereval png images with color depth equals to 1,4,8.
Lazarus seems to load it as a 32 bit image.
The next code always return "32"
function getBPP(var picture :TPicture) : Integer;
var
tmp_pic : TPicture;
begin
tmp_pic := TPicture.Create;
tmp_pic.PNG:= TPortableNetworkGraphic.Create;
if picture.Graphic.MimeType = tmp_pic.Graphic.MimeType then
begin
getBPP:= PIXELFORMAT_BPP[picture.PNG.PixelFormat];
end;
tmp_pic.Free;
end;
How can I obtain the real information of the png files that have contained in the file header?
I need to know when a png is a 1,4 or 8 or 32 bit image to do differents things.
Thanks to all.