Пример #1
0
 /// <summary>
 /// Draws a single line of text.
 /// </summary>
 public static void DrawTextLine(this SKCanvas canvas, string text, Rectangle bounds, Control control, ContentAlignment alignment, bool ellipsis = false)
 => canvas.DrawText(text, control.CurrentStyle.GetFont(), control.LogicalToDeviceUnits(control.CurrentStyle.GetFontSize()), bounds, control.Enabled ? control.CurrentStyle.GetForegroundColor() : Theme.DisabledTextColor, alignment, maxLines: 1, ellipsis: ellipsis);
Пример #2
0
 public static SKSize MeasureText(string text, Control control, Size maxSize)
 => MeasureText(text, control.CurrentStyle.GetFont(), control.LogicalToDeviceUnits(control.CurrentStyle.GetFontSize()), maxSize);
Пример #3
0
 /// <summary>
 /// Draws a string of text.
 /// </summary>
 public static void DrawText(this SKCanvas canvas, string text, Rectangle bounds, Control control, ContentAlignment alignment, int selectionStart = -1, int selectionEnd = -1, SKColor?selectionColor = null, int?maxLines = null, bool ellipsis = false)
 => canvas.DrawText(text, control.CurrentStyle.GetFont(), control.LogicalToDeviceUnits(control.CurrentStyle.GetFontSize()), bounds, control.Enabled ? control.CurrentStyle.GetForegroundColor() : Theme.DisabledTextColor, alignment, selectionStart, selectionEnd, selectionColor, maxLines, ellipsis);
 public static void DrawText(this SKCanvas canvas, string text, Rectangle bounds, Control control, ContentAlignment alignment)
 => canvas.DrawText(text, control.CurrentStyle.GetFont(), control.LogicalToDeviceUnits(control.CurrentStyle.GetFontSize()), bounds, control.CurrentStyle.GetForegroundColor(), alignment);