Questions tagged [android-bitmap]

A Java Object from android.graphics.Bitmap that represents a Bitmap.

Use android.graphics.Bitmap to create an immutable bitmap image for Android.

Android supports bitmap files in three formats:

  1. .png (preferred),
  2. .jpg (acceptable),
  3. .gif (discouraged).

To find more information :

1782 questions
0
votes
1 answer

Shrink wallpaper bitmap drawable to reduce RAM usage

I am currently using device wallpaper as my layout background. The bitmap drawable size is very large on on some devices about 7 MB in Samsung S3. Is there any way to reduce this without consuming more RAM. I am worried about OOM on low memory…
0
votes
0 answers

Why is my R.drawable valie is INT? now I cant populate my listview

I'm having problem inserting image to the Expense_items class, even the getter is having a Bitmap value. However, the image in the drawable have a value of int. Why is that? enter code heremyList.add(new …
Mark Angelo Bajaro
  • 103
  • 1
  • 3
  • 6
0
votes
1 answer

Android BitmapFactory decodeResource Out of Memory Exception

I'm new to android and developing an app that saves large images from drawable folder to phone storage. These files have resolution of 2560x2560 and I want to save these files without loosing image quality. I use following method to save images and…
0
votes
1 answer

Default image resizing in Adapter

I have an adapter which extends from BaseAdapter and in this, I am trying to display a set of images. Before rendering the images, I have to dynamically change the width and height of each image and I am able to accomplish it by dynamically loading…
Raghav
  • 1,014
  • 2
  • 16
  • 34
0
votes
1 answer

android draw on a canvas a circle of a bitmap keeping aspect ration

I have a source bitmap of 300x100. I want to make a circle of 300x300 from this bitmap BUT i want to keep the aspect ratio. so the idea is to resize the source bitmap to 900*300 and them crop the source bitmap to 300x300 FROM THE MIDDLE (so remove…
zeus
  • 12,173
  • 9
  • 63
  • 184
0
votes
0 answers

How to lighten a bitmap in Android?

I'm using a set of bitmaps to draw my SurfaceView and developing a night mode. To turn on night mode I just darken all bitmaps and redraw the SurfaceView: Bitmap newBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(),…
auntyellow
  • 2,423
  • 2
  • 20
  • 47
0
votes
1 answer

java.lang.OutOfMemoryError: [memory exhausted], No Bitmaps

I'm relatively new to Android and have been developing a simple app for a little while. All the features of the app have been working however now I have encountered a java.lang.OutOfMemoryError: [memory exhausted] error. I have read up online about…
jwd40
  • 45
  • 1
  • 6
0
votes
1 answer

When selecting a picture twice - the application crashes + rotate the picture

In my application there is a button to "upload a picture": taking a photo from camera or choosing from gallery. On both options, there are 2 problems: When clicking again to upload another picture - the application crashes. On the first "upload",…
Nick
  • 499
  • 4
  • 11
  • 25
0
votes
0 answers

Painting a part of the view for transparency turns the area to black

I have an activity B and activity A opens from B. In the activity B there is one imageView which holds the snapshot(bitmap) of activity A. I am trying to paint a part of this snapshot to make it transparent so that I can look at the other views of…
0
votes
3 answers

Alpha Value changes makes color become black

imageView.setColorFilter(Color.argb(255, 255, 255, 255)); I would like to change the alpha value to 10 percent (25) like this. imageView.setColorFilter(Color.argb(25, 255, 255, 255)); But the color become black rather than transparent…
0
votes
2 answers

Canvas does not redraw the image

There are multiple scribble apps on here that have an undo button. I haven't implemented those because my code is different, but I have looked at the concepts. I.E storing points in an array. When the program detects touch events: @Override public…
Moynul
  • 635
  • 1
  • 8
  • 30
0
votes
1 answer

Add white spaces to an image to fit to a specific resolution

In apps like NoCrop an image is made to fit a resolution of 1:1 (made square) by adding some extra spaces at the top and bottom of the image (shown below). Similarly, I wish to add some spaces to an image through my Android app, to fit a resolution…
huskygrad
  • 1,257
  • 1
  • 10
  • 21
0
votes
0 answers

Why method doesn't return a bitmap

Somebody knows why the method does not return a bitmap? Instead of bitmap, null is returned from the exception. This method is called in another class (which is in a new thread). Method code: class ClientIn { Socket socket; byte[]…
Se-BASS-tian
  • 51
  • 1
  • 7
0
votes
1 answer

android crop image from gallery nullpointexception

I'm working in Camera.i want to choose image from my gallery and crop selected photo and then show it in my imageview.i wrote some code but i have problem in cropping. this is a my error Caused by: java.lang.NullPointerException: Attempt to…
donoachua
  • 193
  • 2
  • 16
0
votes
1 answer

Undo a horizontally/vertically flipped bitmap

I have succesfully flipped a bitmap horizontally mMirror.preScale(-1.0f, 1.0f);` and vertically mFlip.setScale(-1, 1); mFlip.postTranslate(bitmap.getWidth(), 0); How do i revert these actions?
Droidekas
  • 3,464
  • 2
  • 26
  • 40