0
我有下面这段代码:ZedGraph不配置EMF文件后创建
static internal bool SaveEnhMetafileToFile(Metafile mf, string fileName)
{
bool bResult = false;
IntPtr hEMF;
hEMF = mf.GetHenhmetafile(); // invalidates mf
if (!hEMF.Equals(new IntPtr(0)))
{
StringBuilder tempName = new StringBuilder(fileName);
CopyEnhMetaFile(hEMF, tempName);
DeleteEnhMetaFile(hEMF);
}
return bResult;
}
当CopyEnhMetaFile(hEMF, tempName);
被调用,创建画面,但调用DeleteEnhMetaFile(hEMF);
功能后,因为它由我不能删除照片我的程序(vshost.exe
)。 程序在C#创建
这是什么原因:http://stackoverflow.com/questions/ 14869578/copyenhmetafile-is-not-releasing-the-handle-even-if-deleteenhmetafile-is-cal – PaulF
可能,但在该链接中并没有说明如何删除它 –