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.