General questions

Answered

how to translate the length of radius from mm to pixel

i only know how to translate coordinate using Transform.apply(Point)


Best Answer

Dear Chai Chenxun,

thank you for contacting us and your question.

Indeed, as you have noticed, the iink is using milimiters, and thus converts the coordinates from pixel to milimeters. In order to convert from milimeters to pixel, you should call the "invert" function: https://developer.myscript.com/refguides/interactive-ink/android/1.3/com/myscript/iink/graphics/Transform.html#invert--

Transform tr= editor.getRenderer().getViewTransform();
tr.invert();
Point pixelPoint = tr.apply(milimeterPoint);


Best regards,

Olivier

1 Comment

Answer

Dear Chai Chenxun,

thank you for contacting us and your question.

Indeed, as you have noticed, the iink is using milimiters, and thus converts the coordinates from pixel to milimeters. In order to convert from milimeters to pixel, you should call the "invert" function: https://developer.myscript.com/refguides/interactive-ink/android/1.3/com/myscript/iink/graphics/Transform.html#invert--

Transform tr= editor.getRenderer().getViewTransform();
tr.invert();
Point pixelPoint = tr.apply(milimeterPoint);


Best regards,

Olivier