VisualStyleRenderer.DrawImage VisualStyleRenderer.DrawImage VisualStyleRenderer.DrawImage Method

Definition

Draws the specified image within the specified bounding rectangle.

Overloads

DrawImage(Graphics, Rectangle, Image) DrawImage(Graphics, Rectangle, Image) DrawImage(Graphics, Rectangle, Image)

Draws the specified image within the specified bounds.

DrawImage(Graphics, Rectangle, ImageList, Int32) DrawImage(Graphics, Rectangle, ImageList, Int32) DrawImage(Graphics, Rectangle, ImageList, Int32)

Draws the image from the specified ImageList within the specified bounds.

DrawImage(Graphics, Rectangle, Image) DrawImage(Graphics, Rectangle, Image) DrawImage(Graphics, Rectangle, Image)

Draws the specified image within the specified bounds.

public:
 void DrawImage(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Drawing::Image ^ image);
public void DrawImage (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Drawing.Image image);
member this.DrawImage : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Image -> unit

Parameters

g
Graphics Graphics Graphics

The Graphics used to draw the image.

bounds
Rectangle Rectangle Rectangle

A Rectangle in which the image is drawn.

image
Image Image Image

The Image to draw.

Exceptions

Remarks

If the visual style applies one of the effects specified by the System.Windows.Forms.VisualStyles.IconEffect values to the current element, this method will apply the effect to the drawn image.

DrawImage(Graphics, Rectangle, ImageList, Int32) DrawImage(Graphics, Rectangle, ImageList, Int32) DrawImage(Graphics, Rectangle, ImageList, Int32)

Draws the image from the specified ImageList within the specified bounds.

public:
 void DrawImage(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::ImageList ^ imageList, int imageIndex);
public void DrawImage (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.ImageList imageList, int imageIndex);
member this.DrawImage : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.ImageList * int -> unit

Parameters

g
Graphics Graphics Graphics

The Graphics used to draw the image.

bounds
Rectangle Rectangle Rectangle

A Rectangle in which the image is drawn.

imageList
ImageList ImageList ImageList

An ImageList that contains the Image to draw.

imageIndex
Int32 Int32 Int32

The index of the Image within imageList to draw.

Exceptions

imageIndex is less than 0, or greater than or equal to the number of images in imageList.

Remarks

If the visual style applies one of the effects specified by the System.Windows.Forms.VisualStyles.IconEffect values to the current element, this method will apply the effect to the drawn image.

Applies to