本文整理汇总了C#中ICanvas.DrawText方法的典型用法代码示例。如果您正苦于以下问题:C# ICanvas.DrawText方法的具体用法?C# ICanvas.DrawText怎么用?C# ICanvas.DrawText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICanvas
的用法示例。
在下文中一共展示了ICanvas.DrawText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawElement
protected override void DrawElement (ICanvas canvas)
{
foreach (var s in Spans) {
if (s.Position != null) {
canvas.DrawText (s.Text, new Rect (s.Position.Value, Size.MaxValue), s.Font ?? Font, TextAlignment.Left, Pen, Brush);
} else {
canvas.DrawText (s.Text, Frame, s.Font ?? Font, Alignment, Pen, Brush);
}
}
}
示例2: DrawTextBox
void DrawTextBox (ICanvas c, string text, Point point, Font f)
{
var b = new SolidBrush (Colors.Black);
var bp = new Pen (Colors.Blue);
var rp = new Pen (Colors.Red);
var size = c.MeasureText (text, f);
c.DrawRectangle (new Rect (point, size.Size) + new Size (0, -size.Ascent), bp);
c.DrawLine (point, point + new Size (size.Width, 0), rp);
c.DrawText (text, point, f, b);
}
示例3: DrawElement
protected override void DrawElement(ICanvas canvas)
{
canvas.DrawText(String, Frame, Font, Alignment, Pen, Brush);
}