Reputation: 192
I'm trying to binding an ImageView to byte[].
<ImageView
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"
local:MvxBind="Bitmap CaptchaImage, Converter=InMemoryImage"
android:id="@+id/imageView1" />
I'm using the tutorial from Picture Taking as a guide: https://github.com/MvvmCross/MvvmCross-Tutorials/tree/master/PictureTaking
But the image isn't showing. What could possibly be wrong?
Upvotes: 1
Views: 726
Reputation: 192
The file "PictureChooserPluginBootstrap.cs" was in my Bootstrap folder but somehow wasn't in my project. All I needed was to "Include in Project" option.
Upvotes: 1
Reputation: 1554
Instead of struggling with the xml you can just use this code in your java class:
public static void setImageViewWithByteArray(ImageView view, byte[] data) {
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
view.setImageBitmap(bitmap);
}
Please test it and tell me if it works.
Upvotes: 0