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
0 answers

OutOfMemoryError while trying to process image

I'm trying to decode the image and change image's size. public static Bitmap decodeSampledBitmapFromResource(String picturePath, int reqWidth, int reqHeight) { // First decode with…
ip696
  • 6,574
  • 12
  • 65
  • 128
0
votes
0 answers

getPixels is crashing, am i using it right?

I wrote some JNI to run on Android, it works great except its crashing on the last line. So I was wondering if you can please see if I am using getPixels correct. Documentation for getPixels:…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
0
votes
1 answer

Resize a bitmap eficiently and without losing quality in android

I want to reduce the size of an image on disk without losing quality. I don't want to change the width and height of original image. I want to do something like https://tinyjpg.com/ It reduces the size of image without changing the width and height…
Raghav
  • 8,772
  • 6
  • 82
  • 106
0
votes
1 answer

Not able to get the bitmap from View

In my application i want the image which is inside the linear layout.So for that i have used view.setDrawingCacheEnabled(true); // this is coming as undefined view.buildDrawingCache(); // this is coming as undefined Bitmap cache =…
androGuy
  • 855
  • 2
  • 8
  • 11
0
votes
1 answer

Android saving webview to gallery, intermediate bitmap is too big

I am trying to write a method in android to save the whole webview as an image as following: bitmap = Bitmap.createBitmap(webView.getWidth(), Math.round(webView.getContentHeight() * webView.getScale()), Bitmap.Config.ARGB_8888); …
0
votes
1 answer

How to avoid Out of Memory Error while handling Imageviews

In my app i am selecting a picture from storage or taking a picture using camera and it will set in to an image view.When doing this i got Out of memory Error ,to avoid this I used this method.But it is not working,can anyone help to solve this…
Jack
  • 1,825
  • 3
  • 26
  • 43
0
votes
2 answers

Bitmap size on disk issue in Android

In my Application, i need to download the image from server and save it in SDcard. I am using Volley library to download the image from server. Issue in my Application is when i am downloading the image from server it is 30kb and after downloaded…
Ashok
  • 839
  • 10
  • 21
0
votes
0 answers

Get bitmap attached to fresco drawee?

I have a serious problem about how to get the bitmap from the fresco's drawee so I can upload it to the server. I have tried the draweeView.getDrawable();but it returns drawable and I don't know what to do next.
Lukas Anda
  • 716
  • 1
  • 9
  • 30
0
votes
1 answer

How to set an image on imageView from the gallery and image taken by camera in Android?

In my app I want to set an image on a ImageView from gallery and I want to set an image which is taken by the camera. I have tried this code, when I load image from the gallery, it is working. But when I try to take a picture to set on ImageView,…
Jack
  • 1,825
  • 3
  • 26
  • 43
0
votes
1 answer

Converting ByteBuffer obtained from Mediacodec to a bitmap to store it in SD card

I'm using MediaCodec to read a video file and store the frames on SD card. However it is storing a green rectangle instead of the actual frame. Here is the code: int outIndex = decoder.dequeueOutputBuffer(info, 10000); switch (outIndex) { …
Anirudh GP
  • 345
  • 1
  • 4
  • 15
0
votes
2 answers

How to set an image taken by the camera in to an ImageView?

I am using camera 2 API for creating my own camera. I want to set the image taken by the camera in to an ImageView, which is on another activity. I have tried this code but it is not working. When clicking the camera button the photo is saved to an…
Jack
  • 1,825
  • 3
  • 26
  • 43
0
votes
1 answer

Draw cirble bitmap in onDraw() ImageView without creating another bitmap

I used options.inPurgeable to store bitmap in Ashmem when decoding bitmap. So that I don't wanna create more bitmap on Java heap (causes much GC) when drawing circle bitmap in onDraw() method. My code is below, but it doesn't work private void…
Huy Duong Tu
  • 7,798
  • 5
  • 25
  • 46
0
votes
1 answer

How to display Photograph without distortion in Android Application

My current Android Application allows the user to select any photograph they have on their device. I use this code to display all photographs to allow user selection final Intent intent = new Intent(); intent.setType("image/*"); …
Hector
  • 4,016
  • 21
  • 112
  • 211
0
votes
1 answer

ViewPager Fragment displaying Memory Error for loading ImageViews

I have a ViewPager with a Fragment coming from a PagerAdapter. The Fragment has 4 ImageViews which I want to set their backgrounds with images located in my Drawable folder. The drawables are about 80dp with size about 30kb each. I used the…
user2629955
0
votes
1 answer

How to get Bit Depth of a Bitmap on Mono For Android

In .NET one way to check the bitdepth of a Bitmap image is using the Bitmap class like so: switch (bitmap.PixelFormat) { case System.Drawing.Imaging.PixelFormat.Format1bppIndexed: return 1; case…
Darrell
  • 1,905
  • 23
  • 31
1 2 3
99
100