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

定义

在指定边界内绘制 ImageDraws 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

参数

g
Graphics Graphics Graphics

要在其上进行绘制的 Graphics 表面。The Graphics surface on which to draw.

image
Image Image Image

要绘制的 ImageThe Image to draw.

r
Rectangle Rectangle Rectangle

在其中进行绘制的 Rectangle 边界。The Rectangle bounds to draw within.

align
ContentAlignment ContentAlignment ContentAlignment

要在 Label 中绘制的图像的对齐方式。The alignment of the image to draw within the Label.

继承者说明

创建派生自Label的自己的控件时, 可以使用此方法将图像绘制到控件的图面上。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.

适用于

另请参阅