New to Telerik UI for WinForms? Start a free 30-day trial

Defines reusable text, image, fill, border, and transform settings for drawing a printed element.

Definition

Constructors

Initializes a print element with centered text alignment, a white background, a black border, and the default system font.

C#
public RadPrintElement()

Initializes a print element with the supplied text and the default drawing settings.

C#
public RadPrintElement(string text)
Parameters:textstring

The text to draw in the element.

Properties

Gets or sets the rotation angle of the element.

C#
public float AngleTransform { get; set; }

Gets or sets the back color of the element.

C#
public Color BackColor { get; set; }

Gets or sets the back color of the element.

C#
public Color BorderColor { get; set; }

Gets or sets whether a border should be drawn.

C#
public bool DrawBorder { get; set; }

Gets or sets whether a fill should be drawn.

C#
public bool DrawFill { get; set; }

Gets or sets a value indicating whether the text should be drawn.

C#
public bool DrawText { get; set; }

Gets or sets a value indicating whether html text will be interpreted or will be printed directly.

C#
public bool EnableHtmlTextRendering { get; set; }

Gets or sets the font used for drawing the text.

C#
public Font Font { get; set; }

Gets or sets the fore color of the element.

C#
public Color ForeColor { get; set; }

Gets or sets the image of the element.

C#
public Image Image { get; set; }

Gets or sets the image alignment

C#
public ContentAlignment ImageAlignment { get; set; }

Gets or sets the image layout.

C#
public ImageLayout ImageLayout { get; set; }

Represents a series of points that will define the shape of the element.

C#
public PointF[] Polygon { get; set; }

Gets or sets whether the cell is right to left.

C#
public bool RightToLeft { get; set; }

Gets or sets the scale factors of the element.

C#
public SizeF ScaleTransform { get; set; }

Gets or sets the string format flags.

C#
public StringFormatFlags StringFormatFlags { get; set; }

Gets or sets the string trimming mode.

C#
public StringTrimming StringTrimming { get; set; }

Gets or sets the text to be drawn.

C#
public virtual string Text { get; set; }

Gets or sets the text alignment of the element.

C#
public ContentAlignment TextAlignment { get; set; }

Gets or sets the padding arround the text.

C#
public Padding TextPadding { get; set; }

Methods

Maps the horizontal component of a ContentAlignment value to a drawing alignment.

C#
public virtual StringAlignment GetHorizontalAlignment(ContentAlignment alignment)
Parameters:alignmentContentAlignment

The content alignment to inspect.

Returns:

StringAlignment

Near, Center, or Far.

Returns the bounds after applying the element's configured scale and rotation transforms.

C#
public RectangleF GetTransformedBounds(RectangleF bounds)
Parameters:boundsRectangleF

The untransformed element bounds.

Returns:

RectangleF

The transformed bounds.

Maps the vertical component of a ContentAlignment value to a drawing alignment.

C#
public virtual StringAlignment GetVerticalAlignment(ContentAlignment alignment)
Parameters:alignmentContentAlignment

The content alignment to inspect.

Returns:

StringAlignment

Near, Center, or Far.

Draws the element using the Graphics object in the given rectangle.

C#
public void Paint(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics object used for the drawing.

rectRectangle

The draw area.

Draws the element using the Graphics object in the given rectangle.

C#
public void Paint(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics object used for the drawing.

rectRectangleF

The draw area.

Draws the border when DrawBorder is enabled, following Polygon when it has at least three points.

C#
protected virtual void PaintBorder(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangle

The rectangular fallback bounds.

Draws the border when DrawBorder is enabled, following Polygon when it has at least three points.

C#
protected virtual void PaintBorder(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangleF

The rectangular fallback bounds.

Draws the element layers in fill, image, border, then text order. Override to change the composition for integer-coordinate bounds.

C#
protected virtual void PaintElement(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangle

The element bounds.

Draws the element layers in fill, image, border, then text order. Override to change the composition for floating-point bounds.

C#
protected virtual void PaintElement(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangleF

The element bounds.

Fills the bounds when DrawFill is enabled, using Polygon when it has at least three points.

C#
protected virtual void PaintFill(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangle

The rectangular fallback bounds.

Fills the bounds when DrawFill is enabled, using Polygon when it has at least three points.

C#
protected virtual void PaintFill(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangleF

The rectangular fallback bounds.

Draws the configured Image within the bounds using ImageLayout; ImageAlignment is used for None.

C#
protected virtual void PaintImage(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangle

The image bounds.

Draws the configured Image within the bounds using ImageLayout; ImageAlignment is used for None.

C#
protected virtual void PaintImage(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangleF

The image bounds.

Draws text using integer-coordinate bounds by forwarding to the floating-point overload.

C#
protected virtual void PaintText(Graphics g, Rectangle rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangle

The text bounds.

Draws enabled, non-empty text using the configured padding and alignment, with optional HTML rendering. The configured trimming and format flags apply to non-HTML text.

C#
protected virtual void PaintText(Graphics g, RectangleF rect)
Parameters:gGraphics

The graphics surface used for drawing.

rectRectangleF

The text bounds.