问题描述
在我尝试这样做,在R.drawable文件夹中存储的图像。
Before I tried this , Store image in R.drawable folder ..
Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.image1);
,然后在数据库中使用插入SQL语句。图片就好多了。
and then in database using insert sql statement. Image was much better.
现在我已经存储的数据,所有图像R.drawable文件夹,并用图像视图显示它们
imageview.setImageResource(图片由[i]);
但图像是非常小的和不可见的正常。我能做些什么提高图像质量?
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?
感谢..
推荐答案
最终图像的大小也取决于在哪个文件夹存储图像:绘制,华电国际,绘制,MDPI,绘制,LDPI。当你把图像转换成华电国际的文件夹,其外观比从MDPI和LDPI小。尝试阅读本文档:
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
另一个增强可以通过声明24bit色的支持来实现,因此与Alpha通道的图像将有平滑渐变: activity.getWindow()和setFormat(PixelFormat.RGBA_8888);
但它需要更多的性能来处理。
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.
这篇关于如何提高图像质量时,图像是在可拉伸夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!