You can use a "TMetaFileCanvas" that has EMF support. A code snippet:
procedure TForm1.Button1Click(Sender: TObject);
var
MyMetaFile: TMetaFile;
MyCanvas: TMetafileCanvas;
begin
MyMetaFile:= TMetaFile.Create;
try
MyMetaFile.LoadFromFile('C:\example.emf');
MyCanvas:= TMetafileCanvas.Create(MyMetaFile, 0);
try
MyCanvas.Draw(0, 0, MyMetaFile);
MyCanvas.Pen.Color:= clRed;
MyCanvas.MoveTo(0, 0);
MyCanvas.LineTo(100, 100);
MyCanvas.Free;
Image1.Canvas.Draw(0, 0, MyMetaFile);
finally
MyCanvas.Free;
end;
MyMetaFile.SaveToFile('C:\example.emf');
finally
MyMetaFile.Free;
end;
end;
This way you can load EMF, draw to EMF and save it. But presenting it as a vector graphics from Delphi is another problem altogether. Delphi only works well with bitmap graphics out of the box. But as I understand you only want to read and draw it. To convert it to BMP for instance you can do:
// destroy canvas to transfer the image into the metafile object
FreeAndNil(MyCanvas);
// draw image as normal graphic
BMP.Canvas.Draw(0, 0, MyMetaFile);
EDIT:
As Marco kindly pointed out TMetaFileCanvas probably woun't work correctly with EMF+. Haven't tested that so I can't confirm it.
But there seems to be a unit that works with that.
http://blog.synopse.info/post/2010/04/02/Antialiased-drawing-from-TMetaFile
Download is available from:
http://synopse.info/files/SynGdiPlus.zip
Havent checked it out myself, but it looks appropriate for the job.