ListHashtagAdapter.java 文件源码

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

项目:app_secompufscar 作者:
private Bitmap getTweetImage(String url) {
    byte[] image_b = getImageByte(url);

    Bitmap image;

    if (image_b != null) {
        image = BitmapFactory.decodeByteArray(image_b, 0, image_b.length);
    } else {
        image = BitmapFactory.decodeResource(context.getResources(), R.drawable.pessoa_foto_default);
    }

    Bitmap imageRounded = Bitmap.createBitmap(image.getWidth(), image.getHeight(), image.getConfig());
    Canvas canvas = new Canvas(imageRounded);
    Paint paint = new Paint();
    paint.setAntiAlias(true);
    paint.setShader(new BitmapShader(image, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
    canvas.drawRoundRect((new RectF(0, 0, image.getWidth(), image.getHeight())), 12, 12, paint);
    return imageRounded;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号