Android開発で、大きなBitMapをImageViewにセットしようとしたところ、以下のようなエラーが出て画像が表示されなかった。
Bitmap too large to be uploaded into a texture (3120x4160, max=4096x4096)
ImageViewに読み込む際に、ライブラリを通してやれば出来そうだったので、glideを使って無事解決。
- 変更前
imageView.setImageBitmap(bitmap);
- 変更後
Glide.with(getContext()).load(bitmap).into(imageView);
おまけ
AndroidのImage読み込みライブラリでメジャーなGlideとPicassoを簡単に比較
今回はリリースがより頻繁にされているglideを採用
-
glide
https://github.com/bumptech/glide- last update 7 days ago
- last release 21 days ago
-
picasso
https://github.com/square/picasso- last update 12 days ago
- last release 6 months ago