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

How to add rainbow gradient to an Image in android

I want to add Transparent Rainbow or Spectrum Gradient to Bitmap. In photoshop it is very easy. Now I want to do it programmatically. I have gone through a lot of research. But gradient has only one starting color and one ending. How could I add the…
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
0
votes
3 answers

android getting local image path as https, how to get local phone path?

I've fetched a user selected image from gallery and want to display it in a imageview Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, …
0
votes
1 answer

Android: how can I add different layer to a image view dynamically?

I have one fragment layout with a background image. Programmatically I have to add the different layer to this image because I want to add some particular details depending of some data. There are three different details that it can change in 3…
0
votes
1 answer

Bitmap does not draw after being sent from Android to Server

I have been hitting my head against a wall on this one. In my Android App, I select an image. That all seems to be working fine. I then convert it to a byte array and HTTP POST it to a server. The data written to file on the server side does not…
Aaron Dougherty
  • 727
  • 6
  • 9
0
votes
3 answers

android NullPointerException but I don't know on what

I am trying to FileOutputStream a Bitmap drawn in a canvas, but Logcat gives me : 09-17 14:47:40.203: E/AndroidRuntime(2362): FATAL EXCEPTION: main 09-17 14:47:40.203: E/AndroidRuntime(2362): Process: com.example.drawv2, PID: 2362 09-17…
0
votes
0 answers

BitmapFactory.decodeByteArray sometimes returns null for same image

I am trying to decode a byte array. The decodeByteArray returns NULL sometimes and sometimes it returns bitmap for the same image. I am calling this inside doInBackground. This is what I am doing: public static Bitmap…
0
votes
3 answers

OutOfMemory when loading image from camera

I use the following method to get the bitmap from the camera after I took a photo. On my phone it is working properly but I get a lot of users that get an OutOfMemory error here. I included the stacktrace below. public static Bitmap…
Bart Bergmans
  • 4,061
  • 3
  • 28
  • 56
0
votes
2 answers

I am getting an error while retrieving the Bitmap file using getParcelable in android

I am trying to get my Bitmap file which I have passed into an intent but getParcelable() method return null everytime. following is my java code where I am sending my Bitmap image in intent: Intent cameraIntent = new…
user3971448
0
votes
0 answers

Build an app which animates a circle completing from 0 to 360 in android

I want to build an app which animates a circle completing from 0 to 360 in android. I am new in android and working on animation Paint paint = new Paint(); paint.setColor(Color.BLACK); paint.setStrokeWidth(5); …
0
votes
0 answers

throw if recycled error while painting tilemap android

I'm having trouble loading my game's tilemap onto the screen. My code seems fine and it doesn't contain any errors. I'm new to android game development and I can't seem t figure out what I'm doing wrong. I've read up on how to access access what's…
Macharia
  • 55
  • 2
  • 11
0
votes
0 answers

crop image save in internal storage and get bitmap from uri

I write a code crop image.The image maybe a little big,so I use intent.putExtra("return-data", false); and intent.putExtra("output", outputUri); So I should decode the uri to get bitmap.Just like this(omActivityResult) InputStream is = null; is =…
Egos Zhang
  • 1,334
  • 10
  • 18
0
votes
2 answers

Compress bitmap or byte[] after taking picture

I am trying to reduce the size of the bitmap after taking the picture. I am able to reduce the size to max 900kb but I wan to reduce it further as much as possible First I do this: public static Bitmap decodeSampledBitmapFromResource(byte[] data, …
android_eng
  • 1,370
  • 3
  • 17
  • 40
0
votes
0 answers

SetImageBitmap from internal storage

How to set image Bitmap from internal storage? I checked my code and images are places internal storage, but problem with function SetImageBitmap Any help? Below there is my code, take picture save it to internal storage. public void…
0
votes
2 answers

Android - Display text over specific position of image

In my Android app I have an ImageView which displays an image from assets. What I need to do is to display a text almost centered in the image (what I mean by almost centered is aligned to a rectangle which is near from the center of the image). I…
Ernestina Juan
  • 957
  • 1
  • 9
  • 24
0
votes
2 answers

Memory problems with background images despite small size

I have a pair of background images for both vertical and horizontal layout on my Android app. They are jpeg images with a total size of 236 KB combined. I keep running out of memory though, with the error message "Out of memory on a 23047212-byte…
Petter
  • 773
  • 2
  • 9
  • 19