Replies: 3 comments
-
hey @mtmattei seen this issue here just now and remembered your answer from May at the uno discord where you suggested to me, the canvas from the uno toolkit to evaluate. Maybe this is your expertise here? I am too using the desktop target for my apps that should use them... |
Beta Was this translation helpful? Give feedback.
-
@btkellogg Hello. For a complete SKCanvasElement sample, see this Uno.Samples sample.
You also have to remove the Let me know if you need additional help. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @ramezgerges, delayed in getting back but thank you very much for your response - I was able to get this working in my app! One more question that I have now that I have this in, is that my mouse events do not seem to register. I see that SKCanvasElement inherits from FrameworkElement, but it seems any mouse events (clicking or mouse movement) just do not call the event handlers I have in the class. This was working fine for my SKXamlCanvas (most of my code for SKCanvasElement was copied from there). Do you know what I'd be missing there? Thanks for sending on the SKCanvasElement example, but yeah the interaction there isn't through direct mouse events either.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your issue or question 📝
Something I've been trying for awhile now is getting a cross-platform app where I can make a 2D drawing interface working.
What I see for Uno is there is a SKCanvasElement, which should give hardware accelerated Skia canvas to Skia Desktop targets. I also saw this thread about use of SKCanvasElement vs. SKSwapChainPanel.
However, when I try setting up an app with these elements, I keep running into a bunch of issues:
I'm sure there's a lot I'm doing wrong in setting this up, but it would be really helpful if there was a reference or some sort of sample to go by, something where I could see a 2D Skia canvas working on multiple platforms. Does such a thing exist, and is Uno currently supporting this SKCanvasElement on apps running multiple platforms (even if I need to target something else like SKXamlCanvas or SKSwapChainPanel)?
UnoApp5.zip
For which platforms 📱💻🖥️
Desktop (Windows), WebAssembly, Desktop (macOS), Windows App SDK
Anything else we need to know? 💬
I added the code I'm working with to a .zip file for reference. The classes extending SKCanvasElement are the "TestSkia1.skia.cs" (in the root project folder) and "TestSkia2.skia.cs" (in the Platforms/Desktop folder).
Beta Was this translation helpful? Give feedback.
All reactions