开发者

How to change the size of bitmaps when loaded from xml

开发者 https://www.devze.com 2023-02-15 14:51 出处:网络
I know I can change the size of bitmaps lo开发者_运维技巧aded programmatically by using BitmapFactory.Options (i.e. forcing 32 via ARGB_8888 or 16 bit via RGB_565). Is there an equivalent when loading

I know I can change the size of bitmaps lo开发者_运维技巧aded programmatically by using BitmapFactory.Options (i.e. forcing 32 via ARGB_8888 or 16 bit via RGB_565). Is there an equivalent when loading bitmaps via xml (such as when defining drawables and background images in a layout)? If there isn't a built-in switch available that configures this, is there a way to accomplish this other than stripping the graphics out of the xml and handling them manually?


You cannot do this from XML, you have to do it from code.

0

精彩评论

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