Как преобразовать BMP в WMF
procedure ConvertBMP2WMF
(const BMPFileName, WMFFileName: TFileName);
var
MetaFile: TMetafile;
Bitmap: TBitmap;
begin
Metafile := TMetaFile.Create;
Bitmap := TBitmap.Create;
try
Bitmap.LoadFromFile(BMPFileName);
with MetaFile do
begin
Height := Bitmap.Height;
Width := Bitmap.Width;
Canvas.Draw(0, 0, Bitmap);
SaveToFile(WMFFileName);
end;
finally
Bitmap.Free;
MetaFile.Free;
end;
end;
// Использование:
ConvertBMP2WMF('c:\mypic.bmp', 'c:\mypic.wmf')
|
|