public static Rectangle AddImage(this Graphics graphics, Rectangle bounds, Image overlayImage, ImageOverlayPosition overlayPosition, int? minX = null, int? minY = null) { Rectangle newBounds = bounds.GetImageBounds(overlayImage.Size, overlayPosition, minX, minY); graphics.DrawImage(overlayImage, newBounds); return newBounds; }
public static void AddOverlay(this Graphics graphics, Image image, Rectangle bounds, ImageOverlayPosition overlayPosition) { Rectangle overlayBounds = bounds.GetImageBounds(image.Size, overlayPosition); graphics.DrawImage(image, overlayBounds); }