Пример #1
0
        public override void OnDestroy()
        {
            base.OnDestroy();

            // force our image view to release its references to our bitmaps
            ImageView.SetImageBitmap(null);

            // free the resources we're done with
            if (SourceImage != null)
            {
                SourceImage.Dispose( );
                SourceImage = null;
            }

            if (ScaledCroppedImage != null)
            {
                ScaledCroppedImage.Dispose( );
                ScaledCroppedImage = null;
            }

            if (ScaledSourceImage != null)
            {
                ScaledSourceImage.Dispose( );
                ScaledSourceImage = null;
            }

            // free the cropped image
            if (CroppedImage != null)
            {
                CroppedImage.Dispose( );
                CroppedImage = null;
            }

            SetMode(CropMode.None);
        }
Пример #2
0
 public void Dispose()
 {
     if (SourceImage != null)
     {
         SourceImage.Dispose();
         SourceImage = null;
     }
 }
Пример #3
0
        public void SetImage(Image image, Rectangle selection)
        {
            if (SourceImage != null)
            {
                SourceImage.Dispose();
                SourceImage = null;
            }
            Selection   = selection;
            SourceImage = image;

            if (Editable)
            {
                base.SelectionRegion = new RectangleF(Selection.X, Selection.Y, Selection.Width, Selection.Height);
            }

            UpdateSelectionImage(true);
        }
Пример #4
0
 static void Dispose()
 {
     if (SourceImage != null)
     {
         SourceImage.Dispose();
     }
     if (SpriteList != null)
     {
         foreach (var img in SpriteList)
         {
             if (img != null)
             {
                 img.Dispose();
             }
         }
     }
 }
        void cleanup(bool disposeCurrentImage = false, bool clearImages = true)
        {
            if (clearImages && croppedImages != null)
            {
                croppedImages.ForEach(i => i.Dispose());
                croppedImages.Clear();
            }

            if (SourceImage != null)
            {
                if (disposeCurrentImage)
                {
                    SourceImage.Dispose();
                }

                SourceImage = null;
            }
        }
 public void Dispose()
 {
     SourceImage?.Dispose();
 }