this slowpoke moves

Convert EMF to Bitmap

procedure ConvertEMF2BMP(EMFFileName, BMPFileName: String) ;
var
   MetaFile : TMetafile;
   Bitmap : TBitmap;
begin
   Metafile := TMetaFile.Create;
   Bitmap := TBitmap.Create;
   try
     MetaFile.LoadFromFile(EMFFileName) ;
     with Bitmap do
     begin
       Height := Metafile.Height;
       Width := Metafile.Width;
       Canvas.Draw(0, 0, MetaFile) ;
       SaveToFile(BMPFileName) ;
     end;
   finally
     Bitmap.Free;
     MetaFile.Free;
   end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then begin
   ConvertEMF2BMP(OpenDialog1.FileName, OpenDialog1.FileName + '.bmp');
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate