Click or drag to resize
ICanvasTextInlineObject Interface
An application-implemented interface for drawing graphics inserted into text.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public interface ICanvasTextInlineObject

The ICanvasTextInlineObject type exposes the following members.

Properties
  NameDescription
Public propertyBaseline
Gets the distance from the top of the object to the point where it is lined up with the adjacent text.
Public propertyBreakAfter
Gets the line-breaking behavior after the inline object.
Public propertyBreakBefore
Gets the line-breaking behavior before the inline object.
Public propertyDrawBounds
Gets the bounds of the parts of the text that would get drawn.
Public propertySize
Gets the size of the inline object.
Public propertySupportsSideways
Gets whether the inline object supports being rotated when it's part of vertical text.
Top
Methods
  NameDescription
Public methodDraw
Signals to the app that it should draw the inline object.
Top
Remarks

If your app needs to draw some arbitrary graphics together with a text layout, inline objects are a way to do it. Use CanvasTextLayout's SetInlineObject(Int32, Int32, ICanvasTextInlineObject) to set the inline object for a group of characters in a layout.

The Draw callback allows your app to specify some arbitrary drawing behavior, be it graphics, or text, or anything else. The application may choose to store a CanvasDrawingSession within its implementation of ICanvasTextInlineObject, and issue drawing commands to it from the Draw callback.

Inline objects set to characters within a text layout are drawn along with the rest of the text layout. If the inline object overlaps with the text, the inline object will typically appear on top.

The other use for inline objects are custom trimming signs. When a text layout is trimmed, an app may choose the default of truncation, or an ellipsis, or some other arbitrary drawing routine.

See Also