0

ペン SDK 4.0.7 を使用しています

プログラムでストロークを消去したいのですが、消しゴムが有効になっているときにユーザーが指やペンで行うのとほぼ同じです。

このコードは、プログラムでペン ストロークを描画するために使用されることを知っています。

SpenObjectStroke strokeObj = new SpenObjectStroke(penName, points, pressures, timestamps);

strokeObj.setPenSize(size);
strokeObj.setColor(color);
mSpenPageDoc.appendObject(strokeObj);
mSpenSurfaceView.update();

だから私の質問は: 消しゴム ストロークを描画するにはどうすればよいですか? (重なっているすべてのペンストロークをきれいにします)

4

1 に答える 1

0

私が実装した解決策は、強度が最大値に設定されているときにストロークを消去する機能を持つ MagicPen を使用することでした。

    String penName = SpenPenManager.SPEN_MAGIC_PEN;
    float  penSize =  eraserSettingView.getInfo().size;
    int penColor  = -16777216; // gotten from the max transparent color value of the Magic pen

    SpenObjectStroke strokeObj = new SpenObjectStroke(penName, points, pressures, timestamps);

    strokeObj.setPenSize(size);
    strokeObj.setColor(color);
    mSpenPageDoc.appendObject(strokeObj);
    mSpenSurfaceView.update();
于 2016-05-08T20:07:53.027 に答える