Repository navigation
How can I use Microsoft.Maui.Graphics in UNO? #15097
|
My fundamental issue is that I am preparing to develop an application with writing functionality for use on touchscreen devices, but I find that InkCanvas is missing. Given my extensive experience in touchscreen and handwriting algorithm development, I aim to add an InkCanvas control filled with custom logic on UNO. However, I find that there is a lack of a basic mechanism in UNO, a mechanism that allows for arbitrary drawing on the interface, similar to the capabilities provided by Microsoft.Maui.Graphics or the capabilities of WPF's DrawingContext. Currently, I can only indirectly achieve this function through Microsoft.UI.Xaml.Shapes, but the controllability and performance of this method are poor. I have written a simple UnoInk test application for this, and after three months of development, I find it difficult to implement a feature that can be used in productization without the help of features like Microsoft.Maui.Graphics or WPF's DrawingContext and it is still far from production-ready. In fact, I believe that if I could interface with Microsoft.Maui.Graphics, or even just open up Skia's drawing capabilities to UIElement, etc., I would be capable of creating a fairly good interface. As I am relatively new to UNO, if there are already similar features implemented in UNO, please let me know. I look forward to your assistance and response. |
Replies: 1 comment 24 replies
|
@lindexi which platforms are you targeting? You may be able to use the Composition API, or you can use SkiaSharp directly. Which features from Microsoft.Maui.Graphics are of interest to you? |
This sample works for all uno platforms: https://github.com/unoplatform/Uno.Samples/tree/master/UI/SkiaSharpTest.
You can use a
SKXamlCanvaslike any other control to draw Skia content.