Delphi - база знаний

       

BMP ---> WMF


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')

Взято с Исходников.ru




Содержание раздела