//顯示 MetaFile 文件
var
g: TGPGraphics;
img: TGPImage;
begin
g := TGPGraphics.Create(Canvas.Handle);
img := TGPImage.Create('c:tempx.emf'); {文件要存在}
g.DrawImage(img, 11, 11);
img.Free;
g.Free;
end;
//繪制 MetaFile 文件
var
g: TGPGraphics;
mf: TGPMetafile;
p: TGPPen;
begin
mf := TGPMetafile.Create('c:tempy.emf', Canvas.Handle); {文件不存在則建立; 存在則覆蓋}
g := TGPGraphics.Create(mf);
p := TGPPen.Create(MakeColor(255,255,0,0),2);
g.DrawRectangle(p, 11, 11, 111, 88);
p.Free;
mf.Free;
g.Free;
{文件繪制完成, 並已保存}
end;