Label.CalcImageRenderBounds(Image, Rectangle, ContentAlignment) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Protected Function CalcImageRenderBounds (image As Image, r As Rectangle, align As ContentAlignment) As Rectangle
Parameters
- align
- ContentAlignment
The alignment of content within the control.
Returns
A Rectangle that represents the size and location of the specified image within the control.
Remarks
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. The location of the image is based on the value of the control's ImageAlign property.