0
        layers[0] = view.getDrawable();
        layers[1] = r.getDrawable(R.drawable.dr);

        LayerDrawable layerDrawable = new LayerDrawable(layers);
        int width = layerDrawable.getIntrinsicWidth();
        int height = layerDrawable.getIntrinsicHeight();
        Bitmap bitmap = Bitmap.createBitmap(width, height,  Bitmap.Config.RGB_565);
        Canvas canvas = new Canvas(bitmap);
        layerDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        layerDrawable.draw(canvas);

        view.setImageBitmap(bitmap);

还有其他方法吗?也许是 PorterDuff.Mode?

4

1 回答 1

0

你可以看到这个

LayerDrawable 有一个设置 alpha 的方法。这对你有帮助吗?

于 2015-02-12T12:25:09.777 回答