Android FFImageLoading using URI (Xamarin)
<p>I am trying to load the contact images from a cursor, so I have the URI of each image.</p>

<p>But I would like to use the FFImageLoading library to add these images to the view, so that I can easily load placeholders and do a circle transform.</p>

<p>However, I am having difficulty using the library with a URI - I have tried converting the URI to a url using the Path to use the LoadFromURL method, but that has been unsuccessful.</p>

<p>So I am wondering if it would be better to use the LoadImage or LoadStream methods, but I am unsure how best to do so. </p>

<p>Here is what I essentially want to do</p>

<pre><code>    // use FFImageLoading library to asynchronously:
    await ImageService
        .Instance
        .LoadUrl(item.PhotoURL, TimeSpan.FromHours(Settings.ImageCacheDurationHours))  // get the image from a URL
        .LoadingPlaceholder("placeholderProfileImage.png")                                          // specify a placeholder image
        .Transform(new CircleTransformation())                                                      // transform the image to a circle
        .Error(e =&gt; System.Diagnostics.Debug.WriteLine(e.Message))
        .IntoAsync(viewHolder.ProfilePhotoImageView);
</code></pre>

<p>However, for the images I get from the contacts, I have a Uri and I can load it using the following, but I cant perform a transformation on it:</p>

<pre><code>    var contactUri = ContentUris.WithAppendedId(ContactsContract.Contacts.ContentUri, Contacts[position].LongId);
    var contactPhotoUri = Android.Net.Uri.WithAppendedPath(contactUri, Android.Provider.Contacts.Photos.ContentDirectory);
    viewHolder.ProfilePhotoImageView.SetImageURI(contactPhotoUri);
</code></pre>

<p>Also, for relevance here is how I get the contacts:</p>

<pre><code>    var uri = ContactsContract.Contacts.ContentUri;

    string[] projection = {
        ContactsContract.Contacts.InterfaceConsts.Id,
        ContactsContract.Contacts.InterfaceConsts.DisplayName,
        ContactsContract.Contacts.InterfaceConsts.PhotoId
    };

    // CursorLoader 
    var loader = new CursorLoader(activity, uri, projection, null, null, null);
    var cursor = (ICursor)loader.LoadInBackground();

    if (cursor.MoveToFirst())
    {
        do
        {
            Contacts.Add(new Contact
            {

                LongId = cursor.GetLong(cursor.GetColumnIndex(projection[0])),
                LastName = cursor.GetString(cursor.GetColumnIndex(projection[1])),
                PhotoUrl = cursor.GetString(cursor.GetColumnIndex(projection[2]))
            });
        } while (cursor.MoveToNext());
    }
</code></pre>