I can load and save image files using Skia4Delphi.
Here is my code:
var
LImage: ISkImage;
LSurface: ISkSurface;
LPaint: ISkPaint;
begin
LImage := TSkImage.MakeFromEncodedFile('C:\IMAGE-OLD.PNG');
LPaint := TSkPaint.Create;
LSurface := TSkSurface.MakeRaster(LImage.Width, LImage.Height);
LSurface.Canvas.DrawImage(LImage, 0, 0, LPaint);
LSurface.MakeImageSnapshot.EncodeToFile('C:\IMAGE-NEW.PNG');
end;
How can I resize the image to a defined size (width and height) before saving? (Delphi 10.3.3 VCL)
Here is the code for a simple (stretched) resize: