コード例 #1
0
        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;
            }
        }
コード例 #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    ImageStream.Dispose();
                }

                disposedValue = true;
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        public void Dispose()
        {
            if (!streamingDemo)
            {
                imageStream.Dispose();
                markerStream.Dispose();

                qtmEventListener.StopListening();
                qtmEventListener.Dispose();
            }
            else
            {
                demoStream.Dispose();
                demoStream.Clean();
            }

            streamingDemo = false;
        }
コード例 #5
0
ファイル: ImageData.cs プロジェクト: ztsvvstz/ShareX
 public void Dispose()
 {
     ImageStream.Dispose();
 }