コード例 #1
0
ファイル: DrawPolygons.cs プロジェクト: AlvaIce/GFJT-2020
        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            if (imagelyr != null)
            {
                imagelyr.Dispose();

                imagelyr = null;
            }

            if (m_Polygons != null)
            {
                m_Polygons = null;
            }
            System.GC.Collect();
        }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: CatalogManager.cs プロジェクト: A-F-V/CardCatalog
        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();
        }