BitmapShader shows black background instead of bitmap

445 views Asked by At

In My app, I use a bitmap shader in order to create a round profile image,

this works well, however in the Asus Padfone Infinity it renders as a black circle.

attached the code snippet from my custom ImageView:

        circularBitmapShader = new BitmapShader((Bitmap) this.bitmapData.bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
        circularPaint.setShader(circularBitmapShader);
        circularPaint.setAlpha(alpha);
        circularBitmapShader.setLocalMatrix(matrix);
        bitmapRect.set(0, 0, getWidth(), getHeight());
        if (clipCircleRadius == -1) {
            canvas.drawRoundRect(bitmapRect, bitmapRect.width() / 2, bitmapRect.height() / 2, circularPaint);
        } else {
            canvas.drawRoundRect(bitmapRect, clipCircleRadius, clipCircleRadius, circularPaint);
        }
0

There are 0 answers