iink SDK on Device

Answered

怎样自定义绘制线段的端点

你好,我按照文档 Custom inking | MyScript Developer 自定义了墨迹,画了一条由细到粗的线,但是拿起画笔时,这条线会变成最粗的宽度,如图

画线时

image


拿起笔时

image


drawPath代码

image

请问这是什么原因?我要怎么才能自定义绘制线段的端点,实现类似默认样式的效果?

默认墨迹

image


感谢!


Best Answer

Hello,


Thank you for your update.


You can tune the stroking according to your needs by implementing the custom stroker APIs.

For further information you can refer to the https://developer.myscript.com/docs/interactive-ink/1.5/android/advanced/custom-inking/ page.


You can also modify the brush used to draw stroke by modifying the theme:


editor.setTheme("stroke { -myscript-pen-brush: "+ brush + "; -myscript-pen-width: 0.5 }");



The possible brush values are listed there: https://developer.myscript.com/docs/interactive-ink/1.5/reference/styling/#myscript-pen-brush


Best regards,


Gwenaëlle


Hello,


Thank you for contacting us.


We are currentely quite puzzled by your use case: why would you want to have a custom stroker if you want to mimic the default stroker?


Best regards,


Gwenaëlle

你好,

我们需要的效果和默认笔形会有点差别,另外我还想实现其他的笔形,比如水彩笔。

感谢答复!

Answer

Hello,


Thank you for your update.


You can tune the stroking according to your needs by implementing the custom stroker APIs.

For further information you can refer to the https://developer.myscript.com/docs/interactive-ink/1.5/android/advanced/custom-inking/ page.


You can also modify the brush used to draw stroke by modifying the theme:


editor.setTheme("stroke { -myscript-pen-brush: "+ brush + "; -myscript-pen-width: 0.5 }");



The possible brush values are listed there: https://developer.myscript.com/docs/interactive-ink/1.5/reference/styling/#myscript-pen-brush


Best regards,


Gwenaëlle