After looking for a way to resize TPngObject and maintain the transparency + alpha channels to no avail, I'm trying to use GDI+
Here is my code, and it seems to work fine. it will down/up scale a PNG. Tested on XP so far:
uses GDIPAPI, GDIPOBJ, GDIPUTIL;
procedure TForm1.Button1Click(Sender: TObject);
var
encoderClsid: TGUID;
stat: TStatus;
img, img_out: TGPImage;
begin
img := TGPImage.Create('in.png'); // 200 x 200
img_out := img.GetThumbnailImage(100, 100, nil, nil);
GetEncoderClsid('image/png', encoderClsid);
img_out.Save('out.png', encoderClsid);
img_out.free;
img.Free;
end;
My question: is using GetThumbnailImage
the correct way of doing this? I did not find any other method.