I create app called it ( app A ) which need to store large No. of high resolution images in res drawable folder , ( i know that i can downloaded remotely , but i need to keep it in drawable res folder ) , its:
3000 x 4000 JPEG images taken by digital camera , as this will lead to unacceptable increase app size and lead to rise memory exception when run it on device ,so can we create another app called
( app B ) , just for resizing the images , which will pick this images that will be stored on SD
( just for purpose of resizing ), then resize it to smaller sized images but without loss image quality and keep high image resolution , then save it again to SD either with PNG or JPEG format , so then i can take images from SD card then save it to ( app A ) resource file and use it , with reasonable size and high resolution ,
hope if any one can supply tutorial or link explaining that or an full code answer applying this ,
Note : i tried using computer software as : photoshop or format factory but all affect the resolution.
your help will be highly appreciated and thanks.
This is best solved using image tiling. You break your image into a number of smaller ’tiles’, say 500x500px which are then laid out on a grid – pick your favorite layout. For rendering zoomed in, only those tiles that are on-screen will be drawn.
Here is a reference for more details: How to tile and scroll a large image (10000×10000) in android
To split the image, follow the instructions here: Android – Split Drawable
For really smooth behaviour, you can additionally create a scaled down image from the original and use the downscaled tiles when the grid is zoomed out. Switch back to the original resolution as the user zooms in.
EDIT
There are a few concepts to keep in mind:
The portion of the picture to be shown on the display – the view port. There are two different extremes:
Now, the Android image libraries will help. When you render an image on the display, the libraries will scale the picture to “fit” the pixels on the display – your actual picture will be unaltered.
I hope with this new language that you can see the fundamental constraints and can therefore decide how to proceed.