/// <summary> /// 释放资源 /// </summary> public void Dispose() { if (imagelyr != null) { imagelyr.Dispose(); imagelyr = null; } if (m_Polygons != null) { m_Polygons = null; } System.GC.Collect(); }
protected override void CleanUpLayer(bool bFinal) { if (m_Layer != null) { m_Layer.Dispose(); } if (File.Exists(m_strCacheFileName)) { File.Delete(m_strCacheFileName); } if (bFinal && m_bIsTmp && File.Exists(m_strFileName)) { File.Delete(m_strFileName); } m_Layer = null; m_blnIsChanged = true; }
private void GenerateCardView(List <CatalogCode> codes) { ImageFactory output = new ImageFactory().Load(new Bitmap(1, 1)); foreach (CatalogCode code in codes) { string path = CardPath(code); ImageLayer temp = new ImageLayer(); temp.Image = Image.FromFile(path); temp.Position = new Point(0, output.Image.Height); ResizeLayer rl = new ResizeLayer(new Size(Math.Max(temp.Image.Width, output.Image.Width), output.Image.Height + temp.Image.Height), ResizeMode.BoxPad, AnchorPosition.TopLeft); output.Resize(rl); output.Overlay(temp); temp.Dispose(); } output.Image.Save(folder + tempFolder + tempFile, ImageFormat.Tiff); output.Dispose(); }