Пример #1
0
 /// <summary>
 /// Helper class to redraw the SurfaceImage synchronously
 /// </summary>
 private void RedrawSurfaceImageInternal()
 {
     // Resize the surface image
     _generator.RedrawImageSurface(_surfaceLock, _surface, Options, _canvasBitmap);
     // If AutoResize is allowed and the image is successfully loaded into the canvasBitmap,
     // then update the Size property of the surface as the surface has been resized to match the canvasBitmap size
     if (Options.AutoResize)
     {
         // If the image is successfully loaded into the canvasBitmap, then update the Size property
         // of the surface as the surface has been resized to match the canvasBitmap size
         Size = _canvasBitmap?.Size ?? new Size(0, 0);
     }
 }
        /// <summary>
        /// Helper class to redraw the IImageSurface synchronously
        /// </summary>
        private void RedrawSurface()
        {
            // Resize the surface image
            _generator.RedrawImageSurface(_surfaceLock, _surface, Options, _canvasBitmap);
            // If AutoResize is allowed and the image is successfully loaded into the canvasBitmap,
            // then update the Size property of the surface as the surface has been resized to match the canvasBitmap size
            if (Options.AutoResize)
            {
                // If the image is successfully loaded into the canvasBitmap, then update the Size property
                // of the surface as the surface has been resized to match the canvasBitmap size
                Size = _canvasBitmap?.Size ?? new Size(0, 0);
            }

            Status = _canvasBitmap != null ? ImageSurfaceLoadStatus.Success : ImageSurfaceLoadStatus.Error;

            if (_canvasBitmap != null)
            {
                DecodedPhysicalSize = new Size(_canvasBitmap.SizeInPixels.Width, _canvasBitmap.SizeInPixels.Height);
                DecodedSize         = _canvasBitmap.Size;
            }
        }