以下是我的代码,
Paint mShadow = new Paint();
mShadow.setAntiAlias(true);
mShadow.setShadowLayer(10, 10,10, Color.BLACK);
canvas.save();
canvas.rotate((int)degrees, 100, 100);
canvas.drawBitmap(_image,200,200, mShadow);
canvas.restore();
试过这个,但阴影也会旋转 你怎么能让阴影保持同一方向?
答案 0 :(得分:0)
尝试这样:
Paint mShadow = new Paint();
mShadow.setAntiAlias(true);
mShadow.setShadowLayer(10, 10,10, Color.BLACK);
canvas.drawRect(200, 200, 200+ (float) _image.getWidth(), 200 + (float) _image.getHeight(), mShadow);
canvas.save();
canvas.rotate((int)degrees, 100, 100);
canvas.drawBitmap(_image,200,200, null);
canvas.restore();