What is the .NET equivalent of CreateEnhMetaFile and PlayEnhMetaFile?
I am porting some C ++ code to VB.NET that creates a print job that is multiple pages. Each page has a template of graphic objects (text, lines, curves, etc.), which remain the same on every page, with different data on top of the top for each page.
The template is created at the start of the print job as an in-memory metafile with CreateEnhMetaFile
, and at the start of each page the metafile is pulled into the print device context with PlayEnhMetaFile
.
How do I do this in .NET? As I read the API, it seems like I can import Metafile
from a file or stream, rather than create it from scratch. Is it correct?
Please take a look at the following pages ...
1) http://msdn.microsoft.com/en-us/library/zbk7dbtb.aspx
2) http://msdn.microsoft.com/en-us/library/ms536391.aspx
3) http: // msdn. microsoft.com/en-us/library/1h5aa6y9.aspx
You can create MetaFile object using the following constructor
public Metafile(Stream stream)
take a MemoryStream as the final destination of the metafile commands.
eg
var mf = new MetaFile(new MemoryStream());
Hope it helps.
source to share