[Interest] [ Missing pixels when using drawLine ]

ashish raste rasteashish at gmail.com
Tue Mar 13 08:28:04 CET 2012

*Dear all,

Recently I worked on a paint application, where I implemented a function to
draw whatever a user is scribbling on an image. In the mouseMove event, I
called a function to draw with the previous point and the current point as
its arguments, using the drawLine function of QPainter.

Now, I noticed that the pixels sent to this function are not continuous but
some in-between pixels were being left. I assume that this is due to the
delay for a user->kernel and kernel->user mode switch when calling the
underlying paint-engine's functions to draw the line.

I have looked-up in the documentation of Qt-painting to find how it
internally calls drawLines(), which instead creates a qpainterPath to draw
a curve, line or whatever we scribble. But I couldn't find how the missing
pixels were added in between just knowing the start and end point of a line
(though we know that a curve will contain a large set of small lines, each
having a start and end point)

Is there anyway to track these "missed" pixels i.e to track all the pixels
which are being drawn?

Thanks you!*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120313/e27f1eab/attachment.html>

More information about the Interest mailing list