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

Measures and paints formatted text blocks for the HTML-capable text renderer.

Definition

Namespace:Telerik.WinControls.Primitives

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class TextPrimitiveHtmlImpl : ITextPrimitive

Inheritance: objectTextPrimitiveHtmlImpl

Implements: ITextPrimitive

Constructors

Creates the renderer with its formatted text block marked for parsing.

C#
public TextPrimitiveHtmlImpl()

Fields

Indicates that the formatted text block must be parsed again before it is used.

C#
protected bool isDirty

Properties

Gets or sets the formatted text block used for HTML measurement, painting, and pointer interaction.

C#
public FormattedTextBlock TextBlock { get; set; }

Methods

C#
public bool AllowHTMLRendering()
Returns:

bool

Measures text using the supplied proposed size as a constraint.

C#
public SizeF GetTextSize(SizeF proposedSize, TextParams textParams)
Parameters:proposedSizeSizeF

The size available for measuring the text.

textParamsTextParams

The text content and settings that affect measurement.

Returns:

SizeF

The measured size of the text.

Implements: ITextPrimitive.GetTextSize(SizeF, TextParams)

Measures the text without a caller-specified size constraint.

C#
public SizeF GetTextSize(TextParams textParams)
Parameters:textParamsTextParams

The text content and settings that affect measurement.

Returns:

SizeF

The measured size of the text.

Implements: ITextPrimitive.GetTextSize(TextParams)

This overload is not implemented by the HTML renderer.

C#
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams, ITextElement element)
Parameters:availableSizeSizeF

The size available to the text.

textParamsTextParams

The text settings.

elementITextElement

The text element.

Returns:

SizeF

This method does not return; it always throws.

Exceptions: NotImplementedException

Always thrown.

Measures the desired text size within the available layout size.

C#
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams)
Parameters:availableSizeSizeF

The maximum size available to the text.

textParamsTextParams

The text content and settings that affect measurement.

Returns:

SizeF

The desired size of the rendered text.

Implements: ITextPrimitive.MeasureOverride(SizeF, TextParams)

Forwards pointer movement to the formatted text block and calls its mouse-up handler once while the left button is held.

C#
public void OnMouseMove(object sender, MouseEventArgs e)
Parameters:senderobject

The object associated with the pointer event.

eMouseEventArgs

The mouse-event data.

Implements: ITextPrimitive.OnMouseMove(object, MouseEventArgs)

Paints text using the supplied graphics context and parameters. The built-in backends do not apply the supplied angle and scale.

C#
public void PaintPrimitive(IGraphics graphics, float angle, SizeF scale, TextParams textParams)
Parameters:graphicsIGraphics

The graphics context used to draw the text.

anglefloat

The rotation angle supplied for the paint operation.

scaleSizeF

The scale supplied for the paint operation.

textParamsTextParams

The text content, layout, and rendering settings.

Implements: ITextPrimitive.PaintPrimitive(IGraphics, float, SizeF, TextParams)

Paints text using the supplied text parameters without an explicit transform.

C#
public void PaintPrimitive(IGraphics graphics, TextParams textParams)
Parameters:graphicsIGraphics

The graphics context used to draw the text.

textParamsTextParams

The text content, layout, and rendering settings.

Implements: ITextPrimitive.PaintPrimitive(IGraphics, TextParams)