/// <summary> /// /// </summary> private void CleanImage() { ImageSource.GetInformation().Dispose(); ImageTarget.GetInformation().Dispose(); ImageResult.GetInformation().Dispose(); if (ImageSource.Source != null) { ImageSource.Source = null; } if (ImageTarget.Source != null) { ImageTarget.Source = null; } if (ImageResult.Source != null) { ImageResult.Source = null; } ImageSource.ToolTip = null; ImageTarget.ToolTip = null; ImageResult.ToolTip = null; GC.Collect(); GC.WaitForPendingFinalizers(); GC.WaitForFullGCComplete(); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> private MagickImage GetImage(ImageType type) { MagickImage result = null; if (type != ImageType.Result) { bool source = type == ImageType.Source ? true : false; result = source ? ImageSource.GetInformation().Current : ImageTarget.GetInformation().Current; } else { result = ImageResult.GetInformation().Current; } return(result); }