System.Drawing.Rectangle.Truncate C# (CSharp) Method

Truncate() public static method

public static Truncate ( System value ) : System.Drawing.Rectangle
value System
return System.Drawing.Rectangle
        public static System.Drawing.Rectangle Truncate(System.Drawing.RectangleF value) { throw null; }
        public static System.Drawing.Rectangle Union(System.Drawing.Rectangle a, System.Drawing.Rectangle b) { throw null; }

Same methods

Rectangle::Truncate ( RectangleF value ) : Rectangle

Usage Example

        /// <summary>
        /// Initializes the BitmapPixels class with a source Bitmap.
        /// </summary>
        /// <param name="source">The source Bitmap to load the pixels from.</param>
        public BitmapPixels(Bitmap source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            PixelFormat format = source.PixelFormat;

            if (!ValidPixelFormat(format))
            {
                throw new InvalidPixelFormatException(format);
            }

            GraphicsUnit unit = GraphicsUnit.Pixel;

            bitmapOwner = false;
            bitmap      = source;
            bounds      = Rectangle.Truncate(bitmap.GetBounds(ref unit));
        }