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.

适用于

另请参阅