BitmapDrawableUtil.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:itsnat_droid 作者:
public static NinePatchDrawable createNinePatchDrawable(Bitmap bitmap,Resources res)
{
    byte[] chunk = bitmap.getNinePatchChunk();
    boolean result = NinePatch.isNinePatchChunk(chunk);
    if (!result) throw new ItsNatDroidException("Expected a 9 patch png, put a valid 9 patch in /res/drawable folder, generate the .apk (/build/outputs/apk in Android Studio), decompress as a zip and copy the png file");

    return new NinePatchDrawable(res, bitmap, chunk, new Rect(), "XML 9 patch");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号