Share via


VisualStyleRenderer.DrawImage 方法

定義

在指定的週框內繪製指定的影像。

多載

DrawImage(Graphics, Rectangle, Image)

在指定的界限內繪製指定的影像。

DrawImage(Graphics, Rectangle, ImageList, Int32)

在指定的界限內,繪製指定之 ImageList 中的影像。

DrawImage(Graphics, Rectangle, Image)

在指定的界限內繪製指定的影像。

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
Public Sub DrawImage (g As Graphics, bounds As Rectangle, image As Image)

參數

g
Graphics

用於繪製影像的 Graphics

bounds
Rectangle

在其中繪製影像的 Rectangle

image
Image

要繪製的 Image

例外狀況

gimagenull

備註

如果視覺化樣式將值所 System.Windows.Forms.VisualStyles.IconEffect 指定的其中一個效果套用至目前元素,這個方法會將效果套用至繪製的影像。

適用於

DrawImage(Graphics, Rectangle, ImageList, Int32)

在指定的界限內,繪製指定之 ImageList 中的影像。

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
Public Sub DrawImage (g As Graphics, bounds As Rectangle, imageList As ImageList, imageIndex As Integer)

參數

g
Graphics

用於繪製影像的 Graphics

bounds
Rectangle

在其中繪製影像的 Rectangle

imageList
ImageList

ImageList,包含要繪製的 Image

imageIndex
Int32

要繪製之 imageListImage 的索引。

例外狀況

gimagenull

imageIndex 小於 0,或者大於或等於 imageList 中的影像數目。

備註

如果視覺化樣式將值所 System.Windows.Forms.VisualStyles.IconEffect 指定的其中一個效果套用至目前元素,這個方法會將效果套用至繪製的影像。

適用於