//显示 MetaFile 文件 var g: TGPGraphics; img: TGPImage; begin g := TGPGraphics.Create(Canvas.Handle); img := TGPImage.Create('c:\temp\x.emf'); {文件要存在} g.DrawImage(img, 11, 11); img.Free; g.Free; end;
//绘制 MetaFile 文件 var g: TGPGraphics; mf: TGPMetafile; p: TGPPen; begin mf := TGPMetafile.Create('c:\temp\y.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;