System.Windows.Forms.Label.CalcImageRenderBounds Method

Determines the size and location of an image drawn within the System.Windows.Forms.Label control based on the alignment of the control.

Syntax

protected System.Drawing.Rectangle CalcImageRenderBounds (System.Drawing.Image image, System.Drawing.Rectangle r, System.Drawing.ContentAlignment align)

Parameters

image
The System.Drawing.Image used to determine size and location when drawn within the control.
r
A System.Drawing.Rectangle that represents the area to draw the image in.
align
The alignment of content within the control.

Returns

A System.Drawing.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 System.Windows.Forms.Label, to determine the size and location of an image to draw within the System.Windows.Forms.Label control based on its location within the control. The location of the image is based on the value of the control's Label.ImageAlign property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0