bitmapfactory Questions

4

Which method is more efficient for creating Bitmap out of Drawable from resources? Bitmap myBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_resource); Vs Drawabl...

6

Altough I have very small size image in drawable folder, I am getting this error from users. And I am not using any bitmap function in code. At least intentionally :) java.lang.OutOfMemoryEr...
Pomerleau asked 8/9, 2014 at 7:53

7

Solved

I'm trying to create a Bitmap or Drawable from existing file path. String path = intent.getStringExtra("FilePath"); BitmapFactory.Options option = new BitmapFactory.Options(); option.inPreferredCo...
Cavetto asked 29/5, 2013 at 2:9

8

Solved

I have a file saved locally into the application's private storage. I have verified it exists, however whenever I call BitmapFactory.decodeFile it always returns null. If I save the file as a reso...
Infamy asked 16/5, 2011 at 3:57

8

Solved

I have to print some data on thermal bluetooth printer, I'm doing with this: String message="abcdef any message 12345"; byte[] send; send = message.getBytes(); mService.write(send); It works wel...
Lambrequin asked 25/1, 2013 at 20:43

3

Solved

I have a problem concerning the BitMapFactory.decodeFile. In my app, I want to user to be able to select an image from his/her device or take a photograph. This must then be displayed in an ImageV...
Racer asked 3/3, 2017 at 5:50

4

Thanks to Schermvlieger for asking this question on anddev.org, I'm just copying his question to SO as nobody replied on the other site and I'm also facing the same problem. I was wondering what...
Lacerated asked 28/1, 2011 at 5:39

4

Is there a way to compress Bitmap to a specific byte size? For example, 1.5MB. The matter is all the examples I have seen so far were resizing width and height, but my requirement is to resize the ...
Severance asked 19/8, 2018 at 16:57

2

I am trying to use BitmapFactory.decodefile() in order to create a scaled down version of a camera photo and set it to an imageview in my framelayout. Am following the following instructions from A...

0

Trying to get an image size using the ImageDecoder I can't find any option to get only the size without decoding the image bitmap. With BitmapFactory can be done with: BitmapFactory.Options.inJus...
Plectognath asked 18/1, 2019 at 18:52

3

Solved

How to decode bitmaps from Asset directory in Android 7? My App is running well on Android versions up to Marshmallow. With Android 7 it fails to load images from the Asset directory. My Code: p...
Ecclesiasticus asked 4/9, 2016 at 10:42

1

Solved

In my android application, I upload and download JPEG images. For some images BitmapFactory downsamples the downloaded image and I don't understand why and how to stop it from doing so. I log the B...
Callant asked 2/8, 2018 at 10:39

4

Solved

Hi i am creating a Bitmap from an png image named image.png. The image has the dimension 75 (width) x 92 (height). When I run this code: Bitmap bitmap = BitmapFactory.decodeResource(this.context.g...
Stringhalt asked 9/9, 2011 at 15:0

6

I'm attempting to create a gridview that is loaded with images from a specific folder that resides on an SDCard. The path to the folder is known, ("/sdcard/pictures") , but in the examples I've see...
Hakim asked 18/2, 2011 at 9:50

2

Solved

I want to compress the image taken from a camera to png format to make them smaller in size, so I'm using this code: compressedPictureFile = new File(imagePath); Bitmap bitmap = BitmapFactory.deco...
Jannette asked 23/4, 2013 at 19:2

2

Solved

I'm using following code from here. I want to compress image. BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; Bitmap bmp = BitmapFactory.decodeFile...
Marieann asked 20/11, 2017 at 11:2

2

Solved

I am trying to convert image object to bitmap, but it return null. image = reader.acquireLatestImage(); ByteBuffer buffer = image.getPlanes()[0].getBuffer(); byte[] bytes = new byte[buffer.capa...
Foochow asked 11/6, 2017 at 16:36

5

Solved

I'm looking on 'developer.android.com' to scale down my bitmap file and I found one thing that I don't understand. so I appreciate you give me a little help. Here's a snippet from developer.andro...
Peptize asked 4/12, 2012 at 4:37

2

I have been trying to get a print of an Image but I have not been successful so far.The printer is a locally manufactured 2" thermal printer having a printing resolution of 8dots/mm, 384dots/line, ...
Portal asked 7/6, 2013 at 10:59

2

I have a server with several photos from 1.5 kb to 9 Mb. The photos from PC, tablets and phones. The sever encode them to Base64 strings and then send them to an Android client. One 300 kb photo re...
Chemism asked 28/6, 2016 at 22:7

5

I get a strange Out of Memory error decoding a drawable image resource 960x926px jpg, allocating 3555856 byte. The image is placed only in drawable-xxhdpi (3x) and I am using a hdpi (1.5x) device....

2

Solved

I'm trying to load an screenshot from my Environment.getExternalStorageDirectory() and try to convert it to bitmap public void onPictureTaken(String path) throws IOException { String photoPath ...
Cynic asked 2/3, 2016 at 10:22

1

I am using Picasso library for images downloading using the following code, I've to load many pictures in a loop by resizing them and transforming to circular. Sometimes images are successfully loa...
Dominga asked 16/2, 2016 at 13:26

6

Solved

I get the next exception: Problem decoding into existing bitmap, when setting inBitmap to true; Caused by: java.lang.IllegalArgumentException: Problem decoding into existing bitmap at android.gr...
Modeling asked 12/3, 2014 at 15:3

1

I'm implementing a Lollipop-style notification to a FTP streaming music player app using the new Notification.MediaStyle class. I am setting the album art as my "large icon". Given that the album ...
Bandoleer asked 16/1, 2015 at 13:14

© 2022 - 2024 — McMap. All rights reserved.