简体   繁体   中英

How to draw text on Canvas

Currently, I am able to add various Shape on Canvas by

canvas.Children.Add(line);
canvas.Children.Add(polyLine);
//...

But, how can we draw text, with various font size, font type, ... on it?

TextBlock添加到画布的子项中。

In this example , they are not drawing on canvas but detecting pointer movements and than adding line shapes to the canvas. So I think you cannot draw on canvas directly. There is another post that talks about Drawing Context , so you might want to look into it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM