uses Direct2D;
procedure TForm1.FormPaint(Sender: TObject);
var
cvs: TDirect2DCanvas;
wic: TWICImage;
R: TRect;
begin
wic := TWICImage.Create;
wic.LoadFromFile('C:\Temp\Test.png');
cvs := TDirect2DCanvas.Create(Canvas, ClIEntRect);
cvs.BeginDraw;
cvs.Draw(10, 10, wic);
R := Bounds(wic.Width div 2 + 10, wic.Height div 2 + 10, wic.Width div 2, wic.Height div 2);
cvs.StretchDraw(R, wic, 192);
cvs.EndDraw;
cvs.Free;
wic.Free;
end;
效果圖: