Android-如何防止Android重新调整位图图像大小

For the past two days Ive been struggling with texture issues in opengl where the textures just come up as white boxes on certain devices and on everything else they show up fine. Ive double checked and used only POT (power of two) images and that did not resolve the problem. From what I read Im thinking that android is doing something to the bitmaps on these certain devices that is knocking them out of dimension and then causing the textures to come up blank or white.

These images that I am using are not stored within the apk although I have tried to use images stored in the local resources and it doesnt seem to make a difference whether their stored locally or Im using images streamed to the device in the form of a stream. My only other guess is that I need to do something to keep certain builds of android from resizing the images but I dont know how to do this.

#0

For bitmaps stored as resources with your apk, you can prevent the system from scaling them by putting them in folder res/drawable-nodpi. For images created from a stream, the system normally assumes that they are intended for a medium density (160dpi) display and will scale accordingly. You can prevent this through various api calls as described here.

The recommended approach is to provide separate graphics resources for each screen resolution supported. The basic technique is described here.

#1

Have you tried using 9patch images, If you patch them properly, Android will not scale the images

推荐文章

Visual Basic 6.0和MagentoSoap的问题

Visual Basic 6.0和MagentoSoap的问题

推荐文章

和发动机故障

和发动机故障

推荐文章

如何使用jQuery选择JSF组件?

如何使用jQuery选择JSF组件?

推荐文章

用sqlserver和php在数据库中录制图片

用sqlserver和php在数据库中录制图片

推荐文章

silverlight standalone可以用来制作任务服务器吗?

silverlight standalone可以用来制作任务服务器吗?

推荐文章

TinyMCE-粘贴在Chrome上会失去焦点

TinyMCE-粘贴在Chrome上会失去焦点

推荐文章

在windows服务中持久化变量的公认方法是什么

在windows服务中持久化变量的公认方法是什么

推荐文章

在Plesk 10上的子域上安装SSL证书

在Plesk 10上的子域上安装SSL证书

推荐文章

用php远程实现c++程序

用php远程实现c++程序

推荐文章

透明mysql_错误日志:如何读取mysql_error()两次?

透明mysql_错误日志:如何读取mysql_error()两次?

推荐文章

如果找到用户,请选择最后一行

如果找到用户,请选择最后一行

推荐文章

如何删除FTP服务器上没有扩展名的文件?

如何删除FTP服务器上没有扩展名的文件?

推荐文章

为给定域的git push指定SSH密钥

为给定域的git push指定SSH密钥

推荐文章

Java注释和处理器来标记一个方法,这样它就可以被调用一次而且只能调用一次?

Java注释和处理器来标记一个方法,这样它就可以被调用一次而且只能调用一次?

推荐文章

从XmlDocument获取InnerText引发NullReferenceException

从XmlDocument获取InnerText引发NullReferenceException

推荐文章

记分板php循环

记分板php循环