Attached you find a small test program that shows a known problem in Android when drawing lines with a small slope and with a StrokeWidth of 1.
In some cases the entire line or parts of it are not drawn at all.
When you run the program the default StrokeWidth value equals 1.
In this case the second almost horizontal line is not visible just a few points. Setting the StrokeWidth to 0.99 draws it better.
A StrokeWidth of 0.75 draws even better than a StrokeWidth of 1 but with a darker color.
In the test program you can play with different StrokeWidths to see the differences.
A StrokeWidth of '0' draws lines with a width of 1 pixel (hairline mode).
The problem seems related to the AntiAliasing function for drawing in Android.
The problem also happens when drawing circles.
Erel, is the ANTI_ALIAS_FLAG set by default ?
Best regards.
EDIT: 2012.02.02
Added a Togglebutton to set the antialisaing filter to ON or OFF.
In some cases the entire line or parts of it are not drawn at all.
When you run the program the default StrokeWidth value equals 1.
In this case the second almost horizontal line is not visible just a few points. Setting the StrokeWidth to 0.99 draws it better.
A StrokeWidth of 0.75 draws even better than a StrokeWidth of 1 but with a darker color.
In the test program you can play with different StrokeWidths to see the differences.
A StrokeWidth of '0' draws lines with a width of 1 pixel (hairline mode).
The problem seems related to the AntiAliasing function for drawing in Android.
The problem also happens when drawing circles.
Erel, is the ANTI_ALIAS_FLAG set by default ?
Best regards.
EDIT: 2012.02.02
Added a Togglebutton to set the antialisaing filter to ON or OFF.
Attachments
Last edited: