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); }
public void Dispose() { if (SourceImage != null) { SourceImage.Dispose(); SourceImage = null; } }
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); }
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(); }