1,780 questions
1393 votes
44 answers
654k views
Strange OutOfMemory issue while loading an image to a Bitmap object
I have a ListView with a couple of image buttons on each row. When the user clicks the list row, it launches a new activity. I have had to build my own tabs because of an issue with the camera layout. ...
447 votes
32 answers
590k views
Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM
I want to show the Bitmap image in ImageView from sd card which is stored already. After run my application is crash and getting OutOfMemoryError error of: (java.lang.OutOfMemoryError: Failed to ...
272 votes
24 answers
482k views
How to get Bitmap from an Uri?
How to get a Bitmap object from an Uri (if I succeed to store it in /data/data/MYFOLDER/myimage.png or file///data/data/MYFOLDER/myimage.png) to use it in my application? Does anyone have an idea on ...
160 votes
18 answers
116k views
"Bitmap too large to be uploaded into a texture"
I'm loading a bitmap into an ImageView, and seeing this error. I gather this limit relates to a size limit for OpenGL hardware textures (2048x2048). The image I need to load is a pinch-zoom image of ...
323 votes
7 answers
233k views
Get Bitmap attached to ImageView
Given ImageView image = R.findViewById(R.id.imageView); image.setImageBitmap(someBitmap); Is it possible to retrieve the bitmap?
198 votes
8 answers
319k views
Saving and Reading Bitmaps/Images from Internal memory in Android
What I want to do, is to save an image to the internal memory of the phone (Not The SD Card). How can I do it? I have got the image directly from the camera to the image view in my app its all ...
40 votes
3 answers
39k views
How can I display a bitmap in Compose Image
I have a function that returns a bitmap (which "contains" a QR code) and I wanted to display that bitmap inside an Image (composable function) but I didn't find any way to either convert the ...
175 votes
7 answers
166k views
Android Bitmap to Base64 String
How do I convert a large Bitmap (photo taken with the phone's camera) to a Base64 String?
1 vote
1 answer
59 views
How to apply ColorFilter to a BitmapDescriptor/Drawable?
I need to add a BitmapDescriptor to my Polyline in Jetpack Compose google maps: val arrowBitmapDescriptor: BitmapDescriptor by remember { mutableStateOf(BitmapDescriptorFactory.fromResource(R.drawable....
0 votes
0 answers
219 views
Android jetpack compose to bitmap
I'm trying write compose to bitmap. https://developer.android.com/develop/ui/compose/graphics/draw/modifiers#composable-to-bitmap Text("Hello $name!", modifier = Modifier ....
0 votes
1 answer
56 views
MediaStore.Images.Media.getBitmap(getActivity().getContentResolver() always rotates vertical image to horizontal
In my app, I'm just trying to select multiple images from gallary and show in recyclerview before uploading into server. In recyclerview, the images appear with original orientation. However before ...
0 votes
1 answer
64 views
How to see applied Bitmap rotation in Compose
I have an image resource. I convert it to Bitmap. All I want is to rotate it around the center of the screen. If the rotated Bitmap extends the screen, it should be cut. The entire app looks like this ...
0 votes
1 answer
148 views
Why is sRGB red (#FF0000) incorrectly converted to #EA3323 in Display P3 and then to #d84532 in my Android screen app?
I'm developing an Android app (in Delphi) that loads an image with a pure red color (#FF0000) in the sRGB color space. The image is then decoded into a bitmap with inPreferredColorSpace set to Display ...
65 votes
8 answers
42k views
How to use RoundedBitmapDrawable
Has anyone managed to use RoundedBitmapDrawable? Correct me if I'm wrong, but to my understanding, it makes a circular image from a regular rectangular image. What I've tried so far is this ...
0 votes
0 answers
34 views
Android: setImageBitmap with bitmap of QR I'm generating in runtime is not working
I have this code: private fun initQRCode() { binding?.let { val bindingRequired = it val helloWorld = QRCode.ofRoundedSquares() .withColor(R.color.colorPrimaryMid) ...