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.

適用於

另請參閱