Cheok Yan Cheng
Cheok Yan Cheng

Reputation: 42690

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?

Upvotes: 1

Views: 6190

Answers (2)

Cheok Yan Cheng
Cheok Yan Cheng

Reputation: 42690

Add TextBlock to canvas's children.

Upvotes: 5

Mayank
Mayank

Reputation: 8852

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.

Upvotes: 0

Related Questions