stylus anti-aliasing

24 views
Skip to first unread message

Tamás Ht

unread,
May 31, 2016, 12:31:48 PM5/31/16
to PDFTron PDFNet SDK
Hy!

We are using different tablets (Asus transformer book, HP elite pad, Huawei mediapad, Lenovo ThinkPad) some of these devices can antialias stylus drawn lines some of them are not. The question is: Can I anti-alias the stylus drawn lines in PdfNet?
not the default _PDFViewCtrl.SetAntiAliasing(true);

Thanks in advance!

Ryan

unread,
May 31, 2016, 8:57:38 PM5/31/16
to PDFTron PDFNet SDK
Hi, could you please clarify what you mean by

some of these  devices can antialias stylus drawn lines some of them are not

Also, could you provide a screenshot of what you are looking for.

Tamás Ht

unread,
Jun 1, 2016, 1:27:15 PM6/1/16
to PDFTron PDFNet SDK
Hi Ryan!
I've attached 3 pics
First pic first test text wrote by stylus
First pic second text handdrawn (finger)
On the secon pic named Képernyőfelvétel(10).png you can see the stylus drawn test text zoomed. It's seems there are some crash in the lines.
On the third pic you can see the hand drawn test text zoomed. There are smooth, silky lines.
After I drawing with my hand selected the pen device and clickin to save button the lines become smoother. How can I smoothing the lines after the user lift up the stylus?

Thanks in Advance!
T.
Képernyőfelvétel (9).png
Képernyőfelvétel (10).png
Képernyőfelvétel (11).png

Tamás Ht

unread,
Jun 1, 2016, 1:27:15 PM6/1/16
to PDFTron PDFNet SDK
Hi Ryan!

On the attached pic you can see 3

2016. június 1., szerda 2:57:38 UTC+2 időpontban Ryan a következőt írta:
Képernyőfelvétel (9).png

Ryan

unread,
Jun 2, 2016, 6:02:38 PM6/2/16
to PDFTron PDFNet SDK
This is an issue with curved (smoothed) paths vs straight line segments between the points, rather than with anti-aliasing.

In the ink tool (FreeHandCreate.cs in the PDFViewCtrlTools project) we distinguish between styluses and hand drawn ink, because on most devices (e.g. Surface Pro 2, Surface Pro 3), ink drawn with stylus looks a lot better if it is not smoothed. While ink drawn with the finger still looks a bit rough if you don't smooth it. 

Basically, hand drawn ink is shown using a Bezier curve, while stylus drawn ink is shown using straight line segments.

In the FreeHandCreate tool, this is governed by the mIsStylus member variable. By setting it to false (or ensure it's not set to true) you can alter this behaviour.
Reply all
Reply to author
Forward
0 new messages