public void Apply() { try { var options = new MediaFileGetImageOptions { Width = Width, Height = Height, Quality = Quality, Orientation = (MediaFileImageOrientation)Enum.Parse(typeof(MediaFileImageOrientation), Orientation, true), ResizeAspect = (MediaFileGetImageOptions.ImageResizeAspect)Enum.Parse(typeof(MediaFileGetImageOptions.ImageResizeAspect), ResizeMode, true), }; _img?.Dispose(); _img = _asset.GetImage(options); Details = $"{_img.Width} x {_img.Height} - {Math.Round(_img.Length / 1024d, 2)}KB"; Image = ImageSource.FromStream(() => _img); } catch { Image = null; Details = string.Empty; } }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { ImageStream.Dispose(); } disposedValue = true; } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). ImageStream.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
public void Dispose() { if (!streamingDemo) { imageStream.Dispose(); markerStream.Dispose(); qtmEventListener.StopListening(); qtmEventListener.Dispose(); } else { demoStream.Dispose(); demoStream.Clean(); } streamingDemo = false; }
public void Dispose() { ImageStream.Dispose(); }