Label.CalcImageRenderBounds(Image, Rectangle, ContentAlignment) Label.CalcImageRenderBounds(Image, Rectangle, ContentAlignment) Label.CalcImageRenderBounds(Image, Rectangle, ContentAlignment) Method

定義

根據控制項的對齊方式,決定 Label 控制項內所描繪影像的大小和位置。Determines the size and location of an image drawn within the Label control based on the alignment of the control.

protected:
 System::Drawing::Rectangle CalcImageRenderBounds(System::Drawing::Image ^ image, System::Drawing::Rectangle r, System::Drawing::ContentAlignment align);
protected System.Drawing.Rectangle CalcImageRenderBounds (System.Drawing.Image image, System.Drawing.Rectangle r, System.Drawing.ContentAlignment align);
member this.CalcImageRenderBounds : System.Drawing.Image * System.Drawing.Rectangle * System.Drawing.ContentAlignment -> System.Drawing.Rectangle

參數

image
Image Image Image

Image 用來決定在控制項內描繪時的大小和位置。The Image used to determine size and location when drawn within the control.

r
Rectangle Rectangle Rectangle

Rectangle,表示要描繪影像的區域。A Rectangle that represents the area to draw the image in.

align
ContentAlignment ContentAlignment ContentAlignment

控制項中內容的對齊方式。The alignment of content within the control.

傳回

Rectangle,表示控制項內指定影像的大小和位置。A Rectangle that represents the size and location of the specified image within the control.

備註

您可以在的衍生類別Label中使用這個方法,根據控制項中的位置,判斷要在Label控制項內繪製之影像的大小和位置。You can use this method within a derived class of Label, to determine the size and location of an image to draw within the Label control based on its location within the control. 影像的位置是以控制項的ImageAlign屬性值為基礎。The location of the image is based on the value of the control's ImageAlign property.

適用於

另請參閱