Пример #1
0
        public void Dispose()
        {
            if (iDisposed)
            {
                return;
            }

            try
            {
                if (SourceBitmap != null)
                {
                    if (SourceBitmap.Tag != null && SourceBitmap.Tag is BitmapTag)
                    {
                        System.IO.Stream s = ((BitmapTag)SourceBitmap.Tag).Source;
                        if (s != null)
                        {
                            s.Dispose();
                        }
                    }
                    SourceBitmap.Dispose();
                }
            }
            finally {
                if (destinationBitmap != null)
                {
                    destinationBitmap.Dispose();
                }
            }
            iDisposed = true;
            GC.SuppressFinalize(this);
        }
Пример #2
0
 private void Dispose(bool Disposing)
 {
     if (!Disposed)
     {
         Disposed = true;
         SourceBitmap.Dispose();
         SourceHandle.Free();
         GrayScaleBitmap.Dispose();
         GrayScaleHandle.Free();
         ProcessedBitmap.Dispose();
         ProcessedHandle.Free();
         if (Disposing)
         {
             SourceBitmap    = null;
             SourceArr       = null;
             GrayScaleBitmap = null;
             GrayScaleArr    = null;
             ProcessedBitmap = null;
             ProcessedArr    = null;
         }
     }
 }