Repository navigation
# Ink comes to WinUI 3 ✍️ #12168
Pranav Gupta (pranav-gupta-msft)
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Handwriting is one of those inputs that either feels instant or feels broken. There is no middle ground.
You asked for it in #7426, "Is there a plan/schedule for adding InkCanvas into WinUI desktop?", and again in #10817, when apps moving over from UWP found the control simply was not there.
It is there now. WinUI 3 has
InkCanvasandInkToolbar, available from Windows App SDK 2.5.4-experimental. Between them you get a surface that collects strokes and a tool strip that drives it, so a note app stops being a drawing engine you have to write yourself.Pen
Pencil
Highlighter
Here is the whole thing working. One canvas, one toolbar, no custom drawing code:
A canvas is one element
InkCanvascollects strokes on its own:🎨 The toolbar is the second element
InkToolbarattaches to a canvas throughTargetInkCanvas:💾 Save a picture that is still ink
GifWithEmbeddedIsfwrites an ordinary GIF with the stroke data tucked inside it, so loading the file back returns editable strokes:Attach a title bar and a page, and the two elements above are already a usable note app:
The cream page and window chrome are ordinary WinUI styling around the canvas, left out of the snippets above.
The whole app
MainWindow.xaml
MainWindow.xaml.cs
Try it
Inking ships in the Windows App SDK experimental channel. Add Microsoft.WindowsAppSDK 2.5.4-experimental to a WinUI 3 project, add the two elements above, and you have somewhere to write.
💬 Tell us what you build
We want to hear about it: what you are building, what feels good, and anything that gets in your way. Bugs, rough edges and missing pieces are all useful to us, and the earlier they reach us the more we can do about them.
Start a discussion or file an issue at microsoft/microsoft-ui-xaml.
Happy inking 🙌
Team WinUI
All reactions