Questions tagged [bitmapdrawable]
42 questions
1
vote
1 answer
Dynamic "src" for tag in Android xml
Question: Is there a way to dynamically set the "src" attribute on an XML "bitmap" in an Android XML file?
I have a custom XML drawable named "repeat_background.xml" defined as such:

DiscDev
- 38,652
- 20
- 117
- 133
1
vote
1 answer
LayerDrawable: can this be done more efficiently?
I have an ImageView, full width, and width:height = 3:1, let's call it 1200 x 400. I want to show two Drawables in the ImageView, both of which are only known at runtime. One of the drawables should be placed into the ImageView according to…

mathheadinclouds
- 3,507
- 2
- 27
- 37
1
vote
1 answer
Android BitmapDrawable setTileModeXY REPEAT not working
I am having an issue with BitmapDrawable.setTileModeXY.
I have searched about this issue extensively on Google, StackOverflow and other websites. Most people with a problem seem to be using XML, while people using code who had problems were all on…

Definite
- 21
- 2
1
vote
0 answers
BitmapDrawable doesn't scale correctly in a LayerDrawable
I'm working on a blackjack game. I'm trying to display a player's hand using a layerdrawable. However, the card images aren't scaling correctly. They are far too wide. I've put my code below. Basically, I put a Bitmap into a BitmapDrawable which I…

user3522492
- 125
- 10
1
vote
1 answer
Is there any way that an Animation-List xml set drawable suddenly becomes a BitmapDrawable?
So i have this animation-list drawable and it is a series of images.
-

John Ernest Guadalupe
- 6,379
- 11
- 38
- 71
0
votes
0 answers
Extract image from Android Compiled Resource Datatype
File is located here enter link description here
I got an .xml file from android .apk (from path /res/drawable)
But there is strange format
If I open file by online xml viewer it has the next format.
Some data is similar to SVG format... I have…

FullStackDeveloper
- 23
- 1
- 4
0
votes
1 answer
How to clear BitmapDrawable.getBitmap()' on a null object reference on a null object reference error
Im using this library https://github.com/jgabrielfreitas/BlurImageView to blur images and everything works fine in a normal activity, recently i tried using this library in a custom GridView and got this error
android.graphics.Bitmap…

PeterEssyen
- 15
- 5
0
votes
1 answer
Set offset for BitmapDrawable while repeating in the x and y direction?
I'm making a 2D platformer game. I have created a texture for the platform, that is meant to be repeated over and over to fill the entire platform, without going over. My first attempt was to draw all the pixels from the bitmap manually, but this…

mega12345mega
- 503
- 1
- 6
- 17
0
votes
1 answer
why splash screen in android doesn't fit inside the available space?
I'm using the fallowing xml as splashScreen
-

Yadu
- 2,979
- 2
- 12
- 27
0
votes
2 answers
How to fix deprecated issue in Android Bitmap?
hi guys someone could help me? i'm stucked with this can't find the answer
selectedPhotoUri = data.data
val bitmap = MediaStore.Images.Media.getBitmap(contentResolver, selectedPhotoUri)
selectphoto_imageview_register.setImageBitmap(bitmap)
val…
0
votes
1 answer
Duplicate images while loading the images from android assets as Bitmap and setting ImaegView using glideV4
I tried to retrieve bitmap from the assets and then try to load the Horizontal recyclerview image list using glide as asBitmap(). I am getting the duplicate images and the mismatch images(loading wrong image in place of the required image). Below…

Pradip Tilala
- 1,715
- 16
- 24
0
votes
0 answers
repeate tile image with paths in android
I want to create frame Like this image using path
I want to use a Bitmap that Tile on the Horizontal only, is there any way to do it, so that it will expand only on X like repeat x on CSS. I using the following code but the bitmap tile Horizontal…

nitin londhe
- 1
- 1
0
votes
0 answers
HorizontalScrollView fill with repeatable image
I have a HorizontalScrollview and I want to have a repeatable image, so I can scroll infinite to left or right. This is my XML code

tomhogenkamp
- 83
- 1
- 11
0
votes
2 answers
setBackground from Bitmap API 22+
I have an app that can take a selected image from the users gallery and display it as their background within the app. I have used the code below with success.
Uri selectedImage = data.getData();
String[] filePathColumn = {…

RhysBailey21
- 117
- 3
- 13
0
votes
1 answer
Android: cannot cast BitmapDrawable to a ClipDrawable
I'm trying to implement a simple ClipDrawable using Android Jellybean (SDK 18). I don't understand why I'm getting the casting error for ImageView.getDrawable() when that returns a Drawable, not a BitmapDrawable
Here's my relevant code in the…

M. Smith
- 379
- 1
- 20