开发者

How to improve the image quality when images are in drawable folder

Before I tried this , Store image in R.drawable folder ..

 Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.image1);

and then in开发者_C百科 database using insert sql statement. Image was much better.

Now I have stored data in string array, all images in R.drawable folder and displaying them in image view using imageview.setImageResource(image[i]); But image is very small and not visible properly. what can I do improve the image quality?

thanks..


The final image size depends also, in which folder you store images: drawable-hdpi, drawable-mdpi, drawable-ldpi. When you put images into hdpi folder, their appearance is smaller than from mdpi and ldpi. Try to read this documentation: Screen Support

Another enhancement can be achieved by declaring 24bit color support, so images with alpha channel will have smooth gradients: activity.getWindow().setFormat(PixelFormat.RGBA_8888); but it requires more performance to process.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜