Monobjc.ApplicationServices.CGRect.CGRectInset C# (CSharp) Method

CGRectInset() public static method

Returns a rectangle that is smaller or larger than the source rectangle, with the same center point.
Original declaration is : CGRect CGRectInset ( CGRect rect, float dx, float dy );
public static CGRectInset ( CGRect rect, CGFloat dx, CGFloat dy ) : CGRect
rect CGRect The source rectangle.
dx CGFloat The value by which to adjust the x-coordinates of the source rectangle. To create an inset rectangle, specify a positive value. To create a larger, encompassing rectangle, specify a negative value.
dy CGFloat The value by which to adjust the y-coordinates of the source rectangle. To create an inset rectangle, specify a positive value. To create a larger, encompassing rectangle, specify a negative value.
return CGRect
		public static CGRect CGRectInset(CGRect rect, CGFloat dx, CGFloat dy)
        {
            return CGRectMake(rect.origin.x + dx,
                              rect.origin.y + dy,
                              rect.size.width - 2*dx,
                              rect.size.height - 2*dy);
        }