this slowpoke moves

Convert WMF to Bitmap

procedure WmfToBmp(const FileWmf, FileBmp: TFileName);
var
  MetaFile: TMetafile;
  Bmp:      TBitmap;
begin
  Metafile := TMetaFile.Create;
  Bmp := TBitmap.Create;
  try
    MetaFile.LoadFromFile(FileWmf);
    with Bmp do
    begin
      Height := Metafile.Height;
      Width  := Metafile.Width;
      Canvas.Draw(0, 0, MetaFile);
      SaveToFile(FileBmp);
      Free;
    end;
  finally
    MetaFile.Free;
  end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then begin
  WmfToBmp(OpenDialog1.FileName, OpenDialog1.FileName + '.bmp');
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate