我有自定义视图和画布并绘制位图。 设置画布透明,当我用透明区域绘制位图时,我看不到透明区域。但是,当我设置一些颜色的画布时,我可以看到这种颜色。
snowflakesTriangle = Bitmap.createScaledBitmap(snowflakesTriangle, realBmpWidth,realBmpHeight, true);
SnowFlakeView surface = (SnowFlakeView)findViewById(R.id.snow_flake_view);
surface.setZOrderOnTop(true);
SurfaceHolder holder = surface.getHolder();
holder.setFormat(PixelFormat.TRANSPARENT);
public void onDraw(Canvas canvas) {
canvas.drawARGB(0, 25, 67, 178);
usersTriangle = getResizedBitmap(snowflakesTriangle, relativeBmpWidth, relativeBmpHeight);
canvas.drawBitmap(usersTriangle, marginForBmp, marginForBmp, null);
drawPoints(canvas);
}
如何解决此问题?