尝试使用透明背景绘制并在其上绘制线条。然而,它绘制了一个黑色矩形而不是 transparet。如果我将颜色更改为红色,它可以正常工作。所以我猜这是透明的问题。
drawPoints[currentpoint*4+0] = 0;
drawPoints[currentpoint*4+1] = 10;
drawPoints[currentpoint*4+2] = 20;
drawPoints[currentpoint*4+3] = 40;
Canvas mCanvas = sfh.lockCanvas(new Rect(10,20,50,100));
mCanvas.drawColor(Color.TRANSPARENT);
mCanvas.drawLines(drawPoints,mPaint);
sfh.unlockCanvasAndPost(mCanvas);
为什么会画黑色?