Thank you for the new beta version of the library. Unfortunately there was no change upon upgrading to the new library. I have updated the code to more closely reflect your example, but no luck. Thanks if you have any more ideas.
create:
mView = view;
mAndroidView = aview;
// width, height, min stroke width, max stroke width, 3x # = RGB col
mHw = new HWriting(mAndroidView.getWidth(), mAndroidView.getHeight(),
1.0f, 3.0f, 0, 0, 0);
mBitmap = Bitmap.createBitmap(mAndroidView.getWidth(),
mAndroidView.getHeight(), Bitmap.Config.ARGB_8888);
draw:
mBitmap.eraseColor(0);
int hndl = Global.lockBitmap(mBitmap);
mHw.OnDraw(hndl);
Global.unlockBitmap(mBitmap, hndl);
c.drawBitmap(mBitmap, 0, 0, null);
touchDown:
mHw.OnDown(x, y);
PDFPos pos = mView.vGetPos((int)x, (int)y);
aPage = mView.vGetPage(pos.pageno);
touchMove:
mHw.OnMove(x, y);
touchUp:
mHw.OnUp(x, y);
persist to page:
Page page = aPage.GetPage();
if (page != null)
{
Matrix mat = aPage.CreateMatrix();
Log.v(this.getClass().getName(),
String.format("Persisting hWriting at: %d %d",
vpage.GetVX(mView.vGetX()),
-vpage.GetVY(mView.vGetY())));
page.ObjsStart(); // Docs suggest that this might be a good idea,
// but doesn't seem to help
page.AddAnnotHWriting(mat, mHw, -vpage.GetVX(mView.vGetX()),
-vpage.GetVY(mView.vGetY())); // Not working
mat.Destroy();
mView.vRender(aPage);
mHw.Destroy();
mHw = null;
}