Ó ìåíÿ äðóãàÿ ïðîáëåìà. PNG çàãðóæàåòñÿ íîðìàëüíî è BMP âûâîäèòñÿ ñ íîðìàëüíîé ïðîçðà÷íîñòüþ, ÍÎ ïàëèòðà â BMP ïåðåäàåòñÿ íå òà, ÷òî â PNG. Ìåíüøå öâåòîâ, ñêîëüêî íå ìîãó ñêàçàòü, âðîäå 256, âìåñòî 24 áèò, êàê ïîëîæåíî. Èñïîëüçóþ PngImage, â ÷åì ìîæåò áûòü ïðîáëåìà?
function loadPic(fn:string; bmp:Tbitmap):boolean;
var
ext:string;
png:TPNGObject;
begin
PNG:=TPNGObject.Create;
try
result:=TRUE;
if not absPath(fn) then fn:=myPath+fn;
ext:=extractFileExt(fn);
if comparetext(ext,'.png')=0 then
begin
bmp.Transparent:=FALSE;
// ReadBitmapFromPngFile(fn,bmp);
PNG.LoadFromFile(fn);
bmp.PixelFormat:=pf24bit;
bmp.Assign(PNG);
end
else
begin
if ext <> '.bmp' then fn:=fn+'.bmp';
bmp.loadFromFile(fn);
bmp.transparent:=TRUE;
end;
except
result:=FALSE
end;
png.Free;
end; // loadPic