可以转化为bmp显示和其他的操作啊!
//转化一 bmp->wmf:
procedure BmpToWmf (BmpFile,WmfFile:string);
var
MetaFile : TMetaFile;
MFCanvas : TMetaFileCanvas;
BMP : TBitmap;
begin
MetaFile := TMetaFile.Create;
BMP := TBitmap.create;
BMP.LoadFromFile(BmpFile);
MetaFile.Height := BMP.Height;
MetaFile.Width := BMP.Width;
MFCanvas:=TMetafileCanvas.Create(MetaFile, 0);
with MFCanvas do
begin
Draw(0, 0, BMP);
Free;
end;
BMP.Free;
with MetaFile do
begin
SaveToFile(WmfFile);
Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
BmpToWmf('reboot.bmp','reboot.wmf');
end;
//转化二wmf->bmp
var
temp:Tbitmap;
EMF:TMetaFile;
begin
EMF:=TMetaFile.Create;
temp:=Tbitmap.Create(self);
try
EMF.LoadFromFile(filename1)
temp.Width:=emf.Width;
temp.Height:=emf.Height;
temp.Canvas.Draw(0,0,emf);
temp.SaveToFile(filename2;
finally
temp.free;
emf.free;
end;
end;