i can't find setImageBitmap from ImageSwitcher. is there a way to set it by a bitmap?
UPDATES1 then i found this -> set Image from file URI
But my case is, i have to draw something in the bitmap before it set to ImageSwitcher. So, is there no way to set it via bitmap? if no way, i have to output the image file from modified bitmap then use setImageURI. But this is wasting of memory.
UPDATES2 Alternative: Is there a way to dynamically store the image file from sdcard to R.drawable or R.raw to generate resource/drawable id. Then use it to setImageResource or setImageDrawable?
you can convert bitmap into drawable and assign drawable to image switcher as
Drawable drawable =new BitmapDrawable(bitmap);
mSwitcher.setImageDrawable(drawable);
You can wrap your Bitmap in BitmapDrawable and use ImageSwitcher.setImageDrawable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With