Sorry, I know this is an old thread but I tried BeRoPNG to work with ptcgraph. This is my (simple) example:
Code:
var
f: file;
fsize: longword;
buffer: pbyte;
ImageData: PPNGPixel;
ImageWidth,
ImageHeight:longint;
gd,gm:smallint;
BEGIN
AssignFile(f, 'bluepointer.png');
Reset(f, 1);
fsize := FileSize(f);
buffer := getmem(fsize);
blockread(f, buffer^, fsize);
CloseFile(f);
BeRoPNG.LoadPNG(buffer, fsize, ImageData, ImageWidth, ImageHeight, false);
Gd:=D16bit;
Gm:=m800x600;
InitGraph(Gd, Gm, 'Test');
if GraphResult <> grOk then begin
Writeln('Graphics error: ', GraphErrorMsg(ErrorCode));
Halt(1);
end;
putimage (10,10,imageData^,1);
delay (2000);
closegraph;
freemem(buffer);
freemem(ImageData);
END.
But the result isn't correct (see the attached screenshot). I think the problem is that ptcgraph uses a 16 bit colour format with no alpha channel. Any ideas how this can work?
beropngtest.jpg
Bookmarks