Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

ImageSource -> UIImage

$
0
0

I need to convert ImageSource to UIImage and I checked ImageRenderer for this purpose but I can't compile part of code I got from there.

                    IImageSourceHandler handler;
                    if (imageSource != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(imageSource.GetType())) != null)
                    {
                        try
                        {
                            image = await handler.LoadImageAsync(imageSource, default(CancellationToken), UIScreen.MainScreen.Scale);
                        }
                        catch (OperationCanceledException)
                        {
                            image = null;
                        }
                    }

I get an error Error CS0122: `Xamarin.Forms.Registrar' is inaccessible due to its protection level. Is there other way to implement same thing?

Thanks a lot.


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>