ToolStripRenderer.DrawItemImage(ToolStripItemImageRenderEventArgs) 方法

定义

ToolStripItem 上绘制一个图像。Draws an image on a ToolStripItem.

public:
 void DrawItemImage(System::Windows::Forms::ToolStripItemImageRenderEventArgs ^ e);
public void DrawItemImage (System.Windows.Forms.ToolStripItemImageRenderEventArgs e);
member this.DrawItemImage : System.Windows.Forms.ToolStripItemImageRenderEventArgs -> unit
Public Sub DrawItemImage (e As ToolStripItemImageRenderEventArgs)

参数

e
ToolStripItemImageRenderEventArgs

一个 ToolStripItemImageRenderEventArgs,其中包含用于绘制图像的数据。A ToolStripItemImageRenderEventArgs that contains the data to draw the image.

注解

DrawItemImage 方法提供图像的呈现代码的入口点。The DrawItemImage method provides the entry point to the rendering code for an image. 当重写 ToolStripItem.OnPaint 方法或强制在自定义 ToolStripRenderer中绘制图像时,使用此方法绘制图像。Use this method to draw an image when overriding the ToolStripItem.OnPaint method or to force the image to be drawn in a custom ToolStripRenderer. 若要更改图像的呈现方式,请重写从 ToolStripRenderer派生的类中的 OnDrawItem 方法。To change the way the image is rendered, override the OnDrawItem method in a class derived from ToolStripRenderer.

适用于