question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: load to Bitmap instead of ImageViewAsync

See original GitHub issue

FFImageLoading is pretty fantastic. I have a use case where I’m making Android notifications that require Bitmaps. Could you make an overload of Into that loads into Bitmaps or something similar instead of ImageViewAsyncs?

I did try making a SideEffectTransformation that would copy the bitmap in directly, but immediately worried that caching would prevent future notifications with the same image from displaying properly.

And I tried loading into an ImageViewAsync and doing Draw to draw into a bitmap, but the resulting bitmap was transparent even with FadeAnimation(false).

Thanks for all your hard work!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
daniel-luberdacommented, Nov 29, 2017

You have mixed different FFImageLoading versions in your projects, also remove all bin / obj folders

On Nov 29, 2017 21:35, “Victor Finney” notifications@github.com wrote:

Here is an example of the stack trace: Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task’s exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. —> System.TypeLoadException: Could not resolve type with token 0100013c (from typeref, class/assembly FFImageLoading.TaskParameterPlatformExtensions, FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 at DABApp.Droid.AudioService.fetchBitmap (System.String imageUri) [0x00023] in <e2a16aeec5884a15b39e12b79950e58c>:0 at DABApp.Droid.AudioService+<>c__DisplayClass29_0+<<SetMetaData>b__2>d.MoveNext () [0x0004a] in <e2a16aeec5884a15b39e12b79950e58c>:0 — End of inner exception stack trace — —> (Inner Exception #0) System.TypeLoadException: Could not resolve type with token 0100013c (from typeref, class/assembly FFImageLoading.TaskParameterPlatformExtensions, FFImageLoading.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) at System.Runtime.CompilerServices. AsyncTaskMethodBuilder1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 at DABApp.Droid.AudioService.fetchBitmap (System.String imageUri) [0x00023] in :0 at DABApp.Droid.AudioService+<>c__DisplayClass29_0+<b__2>d.MoveNext () [0x0004a] in :0 <—

And here is the fetchBitmap method:

async Task<Android.Graphics.Bitmap> fetchBitmap(string imageUri) { try { var draw = await ImageService.Instance.LoadUrl(imageUri).DownSample().AsBitmapDrawableAsync(); return draw.Bitmap; } catch (Exception e) { Debug.WriteLine($“Bitmap exception: {e.Message}”); return null; } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/luberda-molinet/FFImageLoading/issues/59#issuecomment-347988096, or mute the thread https://github.com/notifications/unsubscribe-auth/AM8Pv8QAxkrj1IqD_NppwNsd8b5F34GKks5s7cAtgaJpZM4GOEoV .

2reactions
daniel-luberdacommented, Oct 20, 2017

Currently, you should use:

  • await ImageService.Instance.LoadFile(xxx).DownSample(width: xxx).AsBitmapDrawableAsync() for Android
  • await ImageService.Instance.LoadFile(xxx).DownSample(width: xxx).AsUIImageAsync() for iOS
  • await ImageService.Instance.LoadFile(xxx).DownSample(width: xxx).AsBitmapDrawableAsync() for Windows (yeah I noticed bad naming, we should change it in future)

Please mind that on Androidyou should call SetNoLongerDisplayed method if drawable is no longer displayed when not using it with ImageViewAsync (which does it automatically)

Read more comments on GitHub >

github_iconTop Results From Across the Web

FFImageLoading : load into an ImageButton
In Xamarin.Android, to load an image using FFImageLoading, a ImageViewAsync must be used instead of a standard ImageView. I couldn't find what I ......
Read more >
Associate file extension with Xamarin Android application
How to load embedded resource into an Android Bitmap with Xamarin? ... App version 1.0.0, but with current settings, version 2.0.9 would be...
Read more >
Advanced Usage - luberda-molinet/FFImageLoading GitHub ...
Then you can use IntoAsync() instead of Into() try { // IntoAsync does not swallow ... If you want to stop pending loading...
Read more >
MOLA_v1.4_apkpure.com.apk
MOLA_v1.4_apkpure.com.apk. This report is generated from a file or URL submitted to this webservice on June 13th 2019 21:07:28 (UTC)
Read more >
Byte array image example. It was quite tricky to get working - Fit
Byte data is backed by a BytesBuffer and you can get different views of the underlying bytes. I'm using BitmapData. open System //...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found