This tag is for questions related to images on Android
Questions tagged [android-image]
1540 questions
33
votes
5 answers
Upload an Image from camera or gallery in WebView
WebView in this app opens a page with upload button.
Below is the code block that allows to open a dialog box to upload image from gallery or camera.
Within my Activity I have:
private WebView wv;
//make HTML upload button work in Webview
…

Chirag
- 1,189
- 2
- 21
- 43
32
votes
6 answers
Convert bitmap array to YUV (YCbCr NV21)
How to convert Bitmap returned by BitmapFactory.decodeFile() to YUV format (simillar to what camera's onPreviewFrame() returns in byte array)?

Abhijeet Pathak
- 1,948
- 3
- 20
- 28
30
votes
2 answers
Set Imageview to show image in sdcard?
I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say something like
ImageView img = (ImageView) findViewById(R.id.imageView1);…

Vinod
- 31,933
- 35
- 96
- 119
30
votes
4 answers
How do I prepare images for all the Android resolutions?
In iOS preparing graphics is simple. There are either a normal image (height x width) or a retina image which is @2x (2 times height x 2 times width).
However, since I'm new to Android, I see a ton of drawable-* folders in Eclipse where the * can be…

Art Geigel
- 1,915
- 3
- 22
- 24
28
votes
1 answer
android:set gray scale filter to imageView
i use this library to show svg image on imageView , i want to show locked and unlocked mode with this imageView, when state is locked show imageView in grayscale color filter.
something like this code on css :
-webkit-filter:…

mahdi
- 16,257
- 15
- 52
- 73
28
votes
8 answers
Putting some indicator around the image in image move/resize/rotate operations
I would like to Scale, Move, Resize Image. I would like to surround the image with Indicators which guide user what operation these indicators perform i.e. Moving, Rotating, Scaling.
I've tried
Scaling - but it only crops down. No chance to…

Vikalp Patel
- 10,669
- 6
- 61
- 96
27
votes
9 answers
How to change the Tabs Images in the TabHost
I am using the TabHost in my application, I am using four Tabs in my application and I want to use the different Images in the TabHost when the Particular Tab is been Selected and not selected. I need to use to different Images for a particular tab…

David Brown
- 4,783
- 17
- 50
- 75
26
votes
7 answers
Why setImageResource method is not working?
This is the first canvas:

Lester1992
- 493
- 2
- 9
- 20
24
votes
3 answers
How can I display a bitmap in Compose Image
I have a function that returns a bitmap (which "contains" a QR code) and I wanted to display that bitmap inside an Image (composable function) but I didn't find any way to either convert the bitmap into a ImageBitmap or just displaying that bitmap.

JustSightseeing
- 1,460
- 3
- 17
- 37
23
votes
7 answers
Android Studio change transparency of Image Assets
When I create new "Image Asset" (Action Bar and Tab Icon) in Android Studio using my own icon as base, I get finally semi-transparent icons. (Android Studio change original color transparency). How to prevent it and save original colors?
This is…

Elaman Aitymbet
- 515
- 1
- 6
- 21
23
votes
3 answers
Save image to sdcard from drawable resource on Android
I'm wondering how to save an image to user's sdcard through a button click.
Could some one show me how to do it. The Image is in .png format and it is stored in the drawable directory. I want to program a button to save that image to the user's…

Moussa
- 851
- 3
- 10
- 19
22
votes
4 answers
Does android:scaleType="fitCenter" only work with fix Layout_width and Layout_height attributes?
I use Layout_width="fill_parent" and Layout_height="wrap content". If an image is bigger than the ImageView, it will be downscaled perfectly.
However, I never got it working to upscale smaller images. I tried any combination of ScaleType and…

OneWorld
- 17,512
- 21
- 86
- 136
22
votes
6 answers
Disable Android resource / image / PNG optimization
How do I prevent the Android "build process" from optimizing .png images?
I have an Android project with the following res directories:
- /res/
- /res/drawable
- /res/drawable-hdpi
- /res/drawable-hdpi-v5
- /res/drawable-ldpi
-…

Maris B.
- 2,333
- 3
- 21
- 35
21
votes
3 answers
What is the difference between using vector drawable and a set of .png for icons in Android?
What are the pros and cons in using vector drawables vs. using a set of .png for Android system icons?
If they're meant for two different things, what are those?

Vicky Leong
- 1,208
- 3
- 12
- 30
21
votes
6 answers
How to convert Image to PDF?
I am developing an application where I need to convert an Image to PDF. I tried something, but the issue is, Image size in that PDF is very very small. I need solution to fix this. Also I am looking for converting multiple Images into single PDF…

Anish Kumar
- 478
- 4
- 12
- 27