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
19
votes
8 answers

Retrieve bitmap from uri

I have included 'share via myApp' option. I inserted following code in the receiving activity class. // Get the intent that started this activity Intent intent = getIntent(); Uri data = intent.getData(); // Figure out what to do…
Robert
  • 343
  • 1
  • 3
  • 14
19
votes
1 answer

Clearly understand matrix calculation

I have this code snippet. I don't understand the Matrix.preScale and the Bitmap.createBitmap with the matrix passed. What does it mean? Is there any simulation website to understand matrix calculation? Could you give me some websites about…
emeraldhieu
  • 9,380
  • 19
  • 81
  • 139
17
votes
2 answers

Does ImageView.setImageBitmap() recycle the previously set bitmap?

Let's say I have code sort of like the one below: protected void onCreate(Bundle bundle){ this.imageView = (ImageView) contentView.findViewById(R.id.imageView); this.setFirstBitmap(); this.setSecondBitmap(); } private…
W.K.S
  • 9,787
  • 15
  • 75
  • 122
16
votes
2 answers

Databinding an in-memory Bitmap to an ImageView

I have a bitmap in-memory (downloaded from a server application via a proprietary TCP/IP protocol stack) which I want to bind to an ImageView. I am able to manually bind the image using setImageBitmap, however; if I use the databinding library to…
Mike
  • 559
  • 5
  • 21
16
votes
4 answers

Using Glide to load bitmap into ImageView

How can i use Glide library to load Bitmap into my ImageView? I want to create a custom image with text and load it into imageview using Glide. This is my method to create custom bitmap with text public Bitmap imageWithText(String text) { …
Bobby Redjeans
  • 575
  • 1
  • 4
  • 18
15
votes
6 answers

Prevent bitmap too large to be uploaded into a texture android

I need to display original image in full screen in gallery form. For thumb it will be work perfectly and when I try to display that image in full screen with original source it will not be able to display. In most cases if the image resolution is…
Pratik
  • 30,639
  • 18
  • 84
  • 159
14
votes
2 answers

Bad performance when drawing continuously in CustomView

Use case: I need to draw hundred lines and a few pieces of text on my view. I need to give a scrolling effect, for which I capture the ACTION_MOVE event and redraw all the lines with the updated points. To get the desire result I tried with…
VijayRaj
  • 425
  • 1
  • 4
  • 22
13
votes
8 answers

Get Video Thumbnail from Uri

I want to select a video from my Gallery. It's working fine. But now I want to display a Bitmap, as a thumbnail.I tried this code and it's not working, it always says: NullPointerException Bitmap bitmap2 =…
Zocker Bros
  • 173
  • 1
  • 1
  • 9
13
votes
1 answer

programmatically create layer-list

I am trying to programmatically create a layer-list with resized bitmaps as items. From what I have seen BitmapDrawable has been deprecated. The new constructor requires the following parameters - public BitmapDrawable (Resources res, Bitmap…
the_big_blackbox
  • 1,056
  • 2
  • 15
  • 35
13
votes
1 answer

Get Bitmap from TextureView efficiently

I am trying to get each frame from a TextureView, unfortunately trying: textureView.getBitmap(); Results in slow performance is there a faster way to obtain a bitmap. Is it better to use the NDK instead? Looking for actual examples
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
13
votes
1 answer

How to load a bitmap into an image-view with Picasso

Yes, I am using Picasso to load a bitmap. The reason is I am decoding URIs in one part of my adapter, and loading bitmaps in another, and I read here that You should always call Picasso, even if your URL is null. This way it knows that the image…
the_prole
  • 8,275
  • 16
  • 78
  • 163
13
votes
3 answers

Not a DRM File, opening notmally

I am looking for a solution regarding a repeating log print that is caused by calling BitmapFactory.decodeFile. In My app i have a ListView that is being redrawn by a timer every second. The ListView has an ImageView that gets is image source from…
user2143411
  • 131
  • 1
  • 3
12
votes
1 answer

Drawable vs. Bitmap

I am writing a real-time game for Android, and after looking at some code from the samples provided in the SDK, I am confused as to when I should use Bitmap or Drawable for my sprites in my game. What's the difference? Which one is better (faster)…
12
votes
2 answers

How to divide a bitmap into parts that are bitmaps too

I need some info on the possible methods for dividing a bitmap in smaller pieces. More importantly I would need some options to judge. I have checked many posts and I am still not entirely convinced about what to do: cut the portion of bitmap How…
Rubin Basha
  • 292
  • 2
  • 10
11
votes
1 answer

How to save/read inline images in html content to internal/extrenal memory

According to this question I used a custom ImageGatter class to display images that I'm getting from a server in TextView using Picasso public class PicassoImageGetter implements Html.ImageGetter { private TextView textView = null; …