procedure TForm1.Button1Click(Sender: TObject);
procedure WmfToBmp(FicheroWmf,FicheroBmp:string);
var
MetaFile:TMetafile;
Bmp:TBitmap;
begin
{Creamos un Metafile temporal}
{create e temporal Metafile}
Metafile:=TMetaFile.create;
{Creamos un Bitmap temporal}
{Create a Temporal Bitmap}
Bmp:=TBitmap.create;
{cargamos el metafile}
{Load the Metafile}
MetaFile.LoadFromFile(FicheroWmf);
{Dibujamos el Metafile en el canvas del Bitmap}
{Draw the metafile in Bitmap's canvas}
with Bmp do
begin
Height:=Metafile.Height;
Width:=Metafile.Width;
Canvas.Draw(0,0,MetaFile);
{Grabamos el BMP}
{Save the BMP}
SaveToFile(FicheroBmp);
{Liberamos BMP}
{Free BMP}
Free;
end;
{Liberamos Metafile}
{Free Metafile}
MetaFile.Free;
end;
begin
WmfToBmp ('c:\kk\kk.wmf','c:\kk\kk.bmp');
end;
|