I'm developing a UWP application using Win2D, and I need to rotate text using the CanvasControl Drawing session. I used public void DrawText(string text, Vector2 point, Color color)
to render text.
How can I rotate the text to any angle?
I'm developing a UWP application using Win2D, and I need to rotate text using the CanvasControl Drawing session. I used public void DrawText(string text, Vector2 point, Color color)
to render text.
How can I rotate the text to any angle?
Copyright © 2021 Jogjafile Inc.
In Win2D, rotating text can be achieved by setting
CanvasDrawingSession.Transform
.It is worth mentioning that the parameter of
Matrix3x2.CreateRotation
is in radians. If you like to express in angle, you need to convert.The rotation here is centered on the upper left corner of the canvas, if you need to customize the center of rotation, you can write like this: