Duality.ExtMethodsBitmap.SubImage C# (CSharp) Method

SubImage() public static method

Extracts a rectangular portion of the original image.
public static SubImage ( this bm, System.Drawing.Rect rect ) : Bitmap
bm this The original Bitmap.
rect System.Drawing.Rect The rectangular portion to extract.
return System.Drawing.Bitmap
        public static Bitmap SubImage(this Bitmap bm, Rect rect)
        {
            return SubImage(bm,
                MathF.RoundToInt(rect.X),
                MathF.RoundToInt(rect.Y),
                MathF.RoundToInt(rect.W),
                MathF.RoundToInt(rect.H));
        }

Same methods

ExtMethodsBitmap::SubImage ( this bm, Rectangle rect ) : Bitmap
ExtMethodsBitmap::SubImage ( this bm, int x, int y, int w, int h ) : Bitmap