I am trying to make a simple Maui Blazor Hybrid application that would load a picture, and I would be able to adjust brightness in real time. I managed to do it manually just using simple < img > and adjusting it accordingly, but it's very slow when using 4k and above pictures. Works fine with FullHD photos. After a bunch of failed attempts, I decided to move to SkiaSharp, because of recommendations. But I am failing to find an example or a concrete answer how to implement it. When I write this piece of code, I get an unexpected unhandled exception
@using SkiaSharp
@using SkiaSharp.Views.Blazor
<SKCanvasView OnPaintSurface="OnPaintSurface" Width="800" Height="600" />
Is it just not feasible ? Or I am missing something ? I saw an old article that it might not be feasible but it's quite old, and only one person answered....
Any advice, how to implement SkiaSharp, or improve performance in other way, would be greatly appreciated.
I am using .Net8, and I can change to any version that would work the best. I am not attached to any particular library or version.
Also from my understanding the only option is to somehow implement GPU support.
The unhandled error relates to this GitHub known issue Blazor Maui project using Razor component with SkiaSharp fail #5725. SkiaSharp
does not work in mobile blazor as of today and it's a matter of functionality in SkiaSharp and its related Blazor component.
To improve performance, you may also refer to this thread https://stackoverflow.com/questions/46031960/image-brightness-for-big-images-c-sharp.