Increase size of the image view (android) - android

I have an imageview that loads and image in the xml.
I was wonder, how can I programmatically increase the image size ( or reduce it) by scale of 2? (so double it or make it half size)
Please help
Thanks

Related

Resize an image to square resolution

I am developing an android application which resizes android pictures. I was wondering if its possible to resize a file with resolution (1080X1920) to (500X500) square size.
Without looking too bad (quality and dimensions).
Let me show you an example.
First image:
Resized picture:
Answers using code will be appreciated
If you don't want to distort the image you have two options:
Crop the image
Implement the seam carving algorithm
Edit: this assumes you want to fill up the whole square. If not, just keep the width/height ratio and downscale the image properly so that the largest dimension fits in the side of the square.

Draw a big image in center_crop type

I have a big image(about 2Mb 1024 * 540 ARGB8888) which is got via net. This image will be shown in a ImageView which is 800px width and 400px height in CENTER_CROP scale type. And there are 12 this kind of ImageView in a listview.
My question is:
Does android load the whole image into memory in CENTER_CROP mode cause it is very slow when I slide the listview. Maybe I should clip the image before setImageBitmap()? Which is the efficient way?
Read the information from the link bellow. It will help you better to understand how to work with bitmaps in android and even in ListView. You should cash images so you will not download them anytime the ListView is refreshing.And yes,android loads all the image and after that centers it and crops,what you should do is to load in memory only a thumbnail of the all image and display it and not all the image. And as i wrote, you should cash them.
Android Bitmap managing

How to prevent pixels from blending when enlarging images in ImageViews Android

I want to use 16x16 images and blow them up without the pixels blending in Android. I understand it will be very pixel-looking (that's what I want). How can I enlarge an image while keeping the pixel look intact?
Just make sure that before you import the image, it is already the size that you wanted so that if you use it on your image view, the quality of image will stay the same.
i have had the same problem
how to load image as pixel image in android java?
here is how i solved it
width of the pixel square =
width of the screen / num of pixels

difference between setting imageView smaller vs scaling image itself

I guess this question could be applied to both iphone and and android.
When I want to show smaller image,
I can set imageView to smaller size and let iphone handle the resizing to fit in the view.
Or
I can actually resize the image itself.(using opengl call, or such as wrapper call createScaledBitmap in android)
I find option 1 is faster.
I always wondered why?
I also wondered the memory consumed by the image is governed by the size of imageView or image?
This is good question, I think when we resize the imageView to smaller that And image(UIImage) is greater that time memory consumption is more because of that image (UIImage) size is more respect to display in imageView. I think second option would be good to save memory .
Image resizing need extra CPU cycles.So Its better to manually resize the image.

Reduce the size of the image android

How can i reduce the size of the image android programatically.
Size of image can be set in grid view. Is it possible to set the size of image displayed in
Edit Text that is received from grid view selected image.
I have set of images in my gridview. I can reduce the size of the image in grid view display. so when i selct the image in gridview i get the image in edittext with its original size of image bigger. How can i reduce the size to small image.
Please guide me in this issue. Any sample working example shall be very useful for me to understand and work accordingly.
Thanks in advance.
Regards
You should try something like this,
Reduce Image Size

Categories

Resources