CircularSplashView.java 文件源码

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

项目:Depth 作者:
public Bitmap GetBitmapClippedCircle(Bitmap bitmap) {

            final int width = bitmap.getWidth();
            final int height = bitmap.getHeight();
            final Bitmap outputBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

            final Path path = new Path();
            path.addCircle(
                    (float) (width / 2)
                    , (float) (height / 2)
                    , (float) Math.min(width, (height / 2))
                    , Path.Direction.CCW);

            final Canvas canvas = new Canvas(outputBitmap);
            canvas.clipPath(path);
            canvas.drawBitmap(bitmap, 0, 0, null);
            bitmap.recycle();
            return outputBitmap;
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号