CanvasTextLayoutSetCustomBrush Method |
Namespace: Microsoft.Graphics.Canvas.Text
public void SetCustomBrush( int characterIndex, int characterCount, Object brush )
Custom brush objects are an arbitrary piece of metadata that can be attached to a character position in a text layout, so that an app's custom renderer can make sense of them. A custom brush object is passed to a text renderer's DrawGlyphRun, DrawUnderline, DrawStrikethrough, and DrawInlineObject callbacks.
CanvasDrawingSession's DrawTextLayout Overload will ignore any custom brush which isn't an ICanvasBrush.
A custom brush replaces any other brush or color currently set to those characters using SetBrush(Int32, Int32, ICanvasBrush) or SetColor(Int32, Int32, Color).
A null custom brush is valid, and by default the brush assigned to all characters in a text layout is null.