I am trying to draw a line with penSize>=2 on a QImage . That is what I got:
1bFS9uGL-e0.jpg
Here is how I do it
QPen pen
( getLeftColor
(),
getPenSize(),
Qt::SolidLine,
Qt::SquareCap,
Qt::MiterJoin );
painter.setPen( pen );
if ( _startPoint == _endPoint )
painter.drawPoint( _endPoint );
else
painter.drawLine( _startPoint, _endPoint );
painter.end();
QPainter painter( getImage() );
QPen pen( getLeftColor(),
getPenSize(),
Qt::SolidLine,
Qt::SquareCap,
Qt::MiterJoin );
painter.setPen( pen );
if ( _startPoint == _endPoint )
painter.drawPoint( _endPoint );
else
painter.drawLine( _startPoint, _endPoint );
painter.end();
To copy to clipboard, switch view to plain text mode
How can I fix this graphical artifact?
Bookmarks