예제 #1
0
        /// <summary>
        /// Dispose of the image
        /// </summary>
        public void Dispose()
        {
            // has the image already been disposed?
            if (Disposed)
            {
                return;
            }

            // flag the image as disposed
            Disposed = true;

            // free the memory used by the image
            BitsHandle.Free();

            // remove the image data array
            Bits = null;

            // destroy the bitmap object
            DeleteObject(Bitmap.GetHbitmap());

            // dispose the image for good
            Bitmap.Dispose();
            Bitmap = null;

            // Suppress finalization.
            GC.SuppressFinalize(this);
        }
 public void Dispose()
 {
     if (Disposed)
     {
         return;
     }
     Disposed = true;
     Bitmap.Dispose();
     BitsHandle.Free();
 }
 public void Resize(int width, int height)
 {
     Bitmap.Dispose();
     BitsHandle.Free();
     CreateBitmap(width, height);
 }