Skiasharp Ruler segmentation is irregular

DawgDawg Member

I am having some difficulty in creating a ruler using SkiaSharp. Below is my code and it does not draw the ruler segmentation with correct pixel spacing. Some help is needed in explaining the reason for the irregular line spacing.

canvas.DrawLine( 0, info.Height, 0, info.Height / 2, BlackStroke);
canvas.DrawLine(info.Width , info.Height, info.Width, info.Height / 2, BlackStroke);

for (int seg=1; seg <= 23; seg++)
{
    canvas.DrawLine((info.Width/24) * seg, info.Height, (info.Width / 24) * seg, info.Height/2, BlackStroke);
}
Tagged:
Sign In or Register to comment.