![]() ![]() Store image files in the res/drawable folder. For more about WebP, see the WebP documentation. You can convert existing PNG and JPEG images into WebP format before upload. WebP compresses better than other formats for lossless and lossy compression, potentially resulting in images more than 25% smaller than JPEG formats. The WebP format is fully supported from Android 4.2. GIF and BMP formats are supported, but discouraged. Android supports image files in several formats: WebP (preferred), PNG (preferred), and JPG (acceptable). For example, this code retrieves the birthdaycake.png image as a Drawable: Resources res = getResources() ĭrawable drawable = res.getDrawable(R.drawable.birthdaycake) Īn image file is a generic bitmap file. To represent a drawable in your app, use the Drawable class or one of its subclasses. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |