0

详细信息:我正在开发一个 BlackBerry 应用程序,其中一项功能是签名捕获。为此,我正在使用此处给出的示例代码。

我面临一个小问题。

我的应用程序屏幕由一个标题、2 个标签和SignatureField一个VerticalManager.

message.getMovePoints(1, xPoints, yPoints, null);

给出绝对点数(相对于屏幕)

_graphics.drawPathOutline(xPoints,yPoints, null, null, false);

由于触摸和绘图不同步,正在绘制相对于字段的路径。

我的问题:有什么方法可以从中获得相对积分 message.getMovePoints(1, xPoints, yPoints, null)?或者有没有其他方法可以解决这个问题?

4

1 回答 1

1

您应该能够将一些函数放在一起,将坐标转换为字段偏移量:

int YourClass#translateToFieldX(Field theField, int x);
int YourClass#translateToFieldY(Field theField, int y);

或者你可以创建一个函数来获取整个数组并返回一个新的翻译点数组。随你(由你决定。

您对实现这些功能感兴趣的功能是:

Field#getLeft() and Field#getContentLeft()
Field#getTop() and Field#getContentTop()

希望这可以帮助。

于 2010-07-26T18:50:36.867 回答