Xwt.Drawing.BitmapImage.Crop C# (CSharp) Method

Crop() public method

Creates a crop of the image
public Crop ( Rectangle pixelRect ) : BitmapImage
pixelRect Rectangle
return BitmapImage
        public BitmapImage Crop(Rectangle pixelRect)
        {
            var scaleX = Math.Truncate (PixelWidth / Width);
            var scaleY = Math.Truncate (PixelHeight / Height);
            return new BitmapImage (ToolkitEngine.ImageBackendHandler.CropBitmap (Backend, (int)pixelRect.X, (int)pixelRect.Y, (int)pixelRect.Width, (int)pixelRect.Height), new Size (pixelRect.Width / scaleX, pixelRect.Height / scaleY), ToolkitEngine);
        }

Same methods

BitmapImage::Crop ( int x, int y, int pixelWidth, int pixelHeight ) : BitmapImage