我知道我可以从GDI的HENHMETAFILE
获取原始图元文件字节
使用GetEnhMetaFileBits
函数。但是我如何从中获取原始字节
Gdiplus::Metafile
是GDI +对象吗?
答案 0 :(得分:1)
public static void Save(Metafile matafile, Stream stream)
{
using (stream)
{
using (Bitmap bit = new Bitmap(1, 1))
{
using (Graphics gs = Graphics.FromImage(bit))
{
Rectangle rt = new Rectangle(0, 0, matafile.Width, matafile.Height);
using (Metafile mf = new Metafile(stream, gs.GetHdc(), rt, MetafileFrameUnit.Pixel, EmfType.EmfOnly))
{
using (Graphics g = Graphics.FromImage(mf))
{
g.DrawImage(matafile, rt);
}
}
}
}
}
}