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
可能,但在該鏈接中並沒有說明如何刪除它 –