Label.DrawImage(Graphics, Image, Rectangle, ContentAlignment) Label.DrawImage(Graphics, Image, Rectangle, ContentAlignment) Label.DrawImage(Graphics, Image, Rectangle, ContentAlignment) Method

Definition

Draws an Image within the specified bounds.

protected:
 void DrawImage(System::Drawing::Graphics ^ g, System::Drawing::Image ^ image, System::Drawing::Rectangle r, System::Drawing::ContentAlignment align);
protected void DrawImage (System.Drawing.Graphics g, System.Drawing.Image image, System.Drawing.Rectangle r, System.Drawing.ContentAlignment align);
member this.DrawImage : System.Drawing.Graphics * System.Drawing.Image * System.Drawing.Rectangle * System.Drawing.ContentAlignment -> unit

Parameters

g
Graphics Graphics Graphics

The Graphics surface on which to draw.

image
Image Image Image

The Image to draw.

r
Rectangle Rectangle Rectangle

The Rectangle bounds to draw within.

align
ContentAlignment ContentAlignment ContentAlignment

The alignment of the image to draw within the Label.

Notes to Inheritors

When you are creating your own control that derives from Label, you can use this method to draw images onto the surface of the control.

Applies to

See also