You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using SkiaSharp with Xamarin Forms and Prism. Please see here for my previous post with more detail on the setup.
I am using Xam.Plugin.Media to pick a photo from the gallery or take a new one.
I noticed that after selecting/taking a photo that no image was displayed. If I selected another photo the previous was displayed. The shown image in the app was out of sync with the selected one.
I debugged this problem and found that ExecutePaintSurfaceCommand was fired before my image was loaded from the gallery.
I fixed this by making the SKCanvasView a parameter into the ExecutePaintSurfaceCommand, making SKCanvasView a field and then calling _canvasView.InvalidateSurface(); after my image was loaded.
This has a bad smell about it. Is there a better way?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using SkiaSharp with Xamarin Forms and Prism. Please see here for my previous post with more detail on the setup.
I am using Xam.Plugin.Media to pick a photo from the gallery or take a new one.
I noticed that after selecting/taking a photo that no image was displayed. If I selected another photo the previous was displayed. The shown image in the app was out of sync with the selected one.
I debugged this problem and found that ExecutePaintSurfaceCommand was fired before my image was loaded from the gallery.
I fixed this by making the SKCanvasView a parameter into the ExecutePaintSurfaceCommand, making SKCanvasView a field and then calling _canvasView.InvalidateSurface(); after my image was loaded.
This has a bad smell about it. Is there a better way?
XAML:
ViewModel:
and
Thanks
Mark.
Beta Was this translation helpful? Give feedback.
All reactions