I want to convert a runtime image into a native image? why cant i do this in a .net standard project?
The according extension method is only available in uwp, android, and ios assemblies...
Because the type returned is platform-specific. All the UI specific types like MapView, SceneView etc are only available at the platform-specific level.
For .NET Standard you use the RuntimeImage type which is cross-platform.
Ok, then let me pose the question differently.
I have a xamarin.forms project (.net standard). I want to show the thumbnail of an mmpk in a xamarin.forms control. How can i achieve this while I have no ThumbnailUri, just the thumbnail? How do i convert from RuntimeImage to Xamarin.Forms.Image?
Thanks in advance
Peter
I was able to use the StreamImageSource for this:
RuntimeImage img = await mapView.ExportImageAsync(); StreamImageSource sis = new StreamImageSource(); sis.Stream = (token) => img.GetEncodedBufferAsync(); image.Source = sis;
This is good feedback though. I'll see if it's possible to add this extension method to the Xamarin.Forms library.
Thx for the confirmation. I came up with the same. It would be great if you'd put it into the xamarin library.
Greetings
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.