Method DrawAlignedImage
DrawAlignedImage(Graphics, Image, Rectangle, ContentAlignment)
Draws the specified System.Drawing.Image, using its original physical size, with specified alignment.
public static void DrawAlignedImage(this Graphics graphics, Image image, Rectangle bounds, ContentAlignment alignment = ContentAlignment.MiddleCenter)
Parameters
graphics
GraphicsSurface to draw image on.
image
ImageSystem.Drawing.Image to draw.
bounds
RectangleSystem.Drawing.Rectangle structure that specifies the location of the drawn image.
alignment
ContentAlignmentImage alignment.