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
11
votes
1 answer

BitmapFactory downsamples unexpectedly image

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 Bitmap object size when I upload and download the…
jolivier
  • 7,380
  • 3
  • 29
  • 47
11
votes
2 answers

Distorting an image to a quadrangle fails in some cases on Android

I'm using matrix.setPolyToPoly function to transform a selected region (4 corners) of a bitmap into a rectangle and normally it works amazing. But in the next example: The polyToPoly function fails the perspective transform: I have drawn two lines…
Pep Santacruz
  • 487
  • 3
  • 11
11
votes
1 answer

Android Bitmap Masking (Xfermode) leaves opaque black background behind

I have a custom view and in the onDraw(), I am trying to perform bitmap masking. I have a squareBitmap (red color) which fills the whole view, and I have a circleBitmap (blue color) that acts as the mask. I am using the mode:…
Henry
  • 17,490
  • 7
  • 63
  • 98
11
votes
1 answer

Size of MediaStyle LargeIcon

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 art is taken directly from the file currently being…
initramfs
  • 8,275
  • 2
  • 36
  • 58
11
votes
5 answers

Reuse drawable images for different screen sizes and densities on Android

Context: I'm developing an Android application for tablets (landscape) with image resources which has a resolution of 1920x1200. That resolution fits on the following screen sizes and densities: drawable-xlarge-hdpi drawable-large-xhdpi Problem: If…
jbc25
  • 1,192
  • 2
  • 14
  • 20
11
votes
2 answers

Convert Android Bitmap to OpenCV Mat and backwards

I wanted to simply convert a bitmap from Android to a Mat object for OpenCV. This topic is often adressed on Stack Overflow. For example: convert Mat to Bitmap Opencv for Android ; convert Bitmap to Mat after capture image using android camera…
DanS
  • 183
  • 1
  • 2
  • 12
10
votes
1 answer

Using canvas and bitmap in Android , how to get this image?

I am new in android. I am trying to draw this image(match statistic) and fill the image with color with 10% to 100% . I tried this much and this is image this is the code public class DrawView extends View { Paint paint = new Paint(); public…
10
votes
4 answers

Position an Image View as Overlay Image on Camera Preview

Hello There I am coding a Camera App using Android Camera API! It has the following functions: The app has an image view over the camera preview The user can drag and drop that image view on the camera preview The drop event catch the position of…
Java Nerd
  • 958
  • 3
  • 19
  • 51
9
votes
1 answer

RecyclerView and async Loading

I have a slight problem. Need a nudge in the right direction. I am doing a video editor like Vine and/or instagram. Where they show a timeline with screencaps from the video It just adds more pictures depending on the videos duration. What i did…
Jemil Riahi
  • 1,360
  • 5
  • 18
  • 38
9
votes
5 answers

BitmapFactory.decodeResource and inexplicable Out of Memory

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. Two question: why I get the error though having…
GPack
  • 2,494
  • 4
  • 19
  • 50
9
votes
5 answers

How do I make a puzzle app in droid without running out of memory?

I notice that other puzzle apps from the google play store can go up to as many as 400 separate movable puzzle pieces I have been attempting to learn how to at least take an image that will represent my puzzle, Crop certain sections and mask the…
user1091368
  • 359
  • 1
  • 4
  • 17
9
votes
1 answer

How to change android rating Bar stars?

I am trying to change the stars of my rating bar by creating new style, this what i did :