A sample implementation of an InkCanvas custom control in C# for WinUI3, as only one file InkCanvas.cs (and it's associated style in Generic.xaml).
It's inspired by the "real" InkCanvas code available here https://github.com/microsoft/microsoft-ui-xaml/blob/main/src/controls/dev/InkCanvas/InkCanvas.cpp but still in experimental channel.
The InkCanvas also has a GetBitmap function that creates a SoftwareBitmap from the strokes (with transparent or opaque background).
It's only been tested on WinAppSDK 2.0+ but already allows nice drawings 😅
PS: This sample's using DirectNAot and WicNet for all Windows Inking, Direct Composition, Direct2D and WIC interop definitions.