简体   繁体   中英

SkiaSharp in Blazor for desktop app without WASM ( Blazor Hybrid? )

I want to use SkiaSharp in a Blazor desktop app ( Windows, Mac, Linux, etc. )

I know about Blazor Hybrid ( Blazor Desktop ) but I didn't find any way to integrate SkiaSharp.

So basically what I want is a way to use SkiaSharp in a Blazor desktop app but without WASM. Does such a thing exist?

Short Answer: No; Not Possible. (Unless I am fundamentally wrong about some detail below.)

Long Answer:

  • In Blazor Hybrid, the view is essentially a browser window.
  • For what you seek to be possible, it has to be fully compatible with web standards.
  • So even though this is inside a desktop app, it comes down to asking how to do SkiaSharp inside a browser.
  • Therefore, it has to run in WASM.

OTOH, you CAN run SkiaSharp in the NOT BLAZOR part of Maui.

But that won't be inside a Blazor Component.

If you've laid out a Maui screen (window) such that Blazor WebView is only part of what is showing, SkiaSharp could be somewhere on the screen; just not integrated into Blazor.

Its even possible to OVERLAY other Maui controls on top of the Blazor View. But the Maui controls and the Blazor content won't be aware of each other's location on the screen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM