How can I set the source of a UIImage to an ImageSource?
I think it is not possibel, you can use a byte or Splat
private Task<UIImage> GetImageFromImageSource(ImageSource imageSource)
IImageSourceHandler handler = null;
if (imageSource is FileImageSource)
handler = new FileImageSourceHandler();
else if (imageSource is StreamImageSource)
handler = new StreamImagesourceHandler(); // sic
else if (imageSource is UriImageSource)
handler = new ImageLoaderSourceHandler(); // sic
throw new NotImplementedException();
Internally Xamarin.Forms has a mechanism for registering these handlers with the different types of ImageSource subclasses, but that registration system seems to be internal. The actual handlers and the interface, though, are not internal, and I think you can use them safely.
How to Implement that code in Xamarin Android ?
I have an example of the Android equivalent here.
EDIT: Make sure you remove this line, which is for the custom renderer I was building:
var blurredBitmap = await Task.Run(() => CreateBlurredImage(originalBitmap, 25));
Just return originalBitmap instead.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies