Click or drag to resize
CanvasTextLayoutSetCustomBrush Method
Sets the custom brush associated with a group of characters in the text layout.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public void SetCustomBrush(
	int characterIndex,
	int characterCount,
	Object brush


Type: SystemInt32
Type: SystemInt32
Type: SystemObject

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.

See Also