//顯示圖像var
//按標准的高度與寬度顯示圖像
g: TGPGraphics;
img: TGPImage;
begin
g := TGPGraphics.Create(Self.Canvas.Handle);
img := TGPImage.Create('c:\temp\x.jpg');
g.DrawImage(img,10,10); {參數2、3是坐標}
img.Free;
g.Free;
end;var
//按指定高度與寬度顯示圖像
g: TGPGraphics;
img: TGPImage;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:\temp\x.jpg');
g.DrawImage(img, 10, 10, img.GetWidth, img.GetHeight);
img.Free;
g.Free;
end;var
g: TGPGraphics;
img: TGPImage;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:\temp\x.jpg');
g.DrawImage(img, 10, 10, 100, 200);
img.Free;
g.Free;
end;
//略縮圖var
g : TGPGraphics;
img, imgSmall: TGPImage;
begin
g := TGPGraphics.Create(Canvas.Handle);
img:= TGPImage.Create('c:\temp\x.jpg');
imgSmall := img.GetThumbnailImage(48, 60, nil, nil);
g.DrawImage(imgSmall, 10, 10, imgSmall.GetWidth, imgSmall.GetHeight);
img.Free;
imgSmall.Free;
g.Free;
end;