//显示图像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;