Important: Please read the Qt Code of Conduct -

Qt Graphics scene add point for generate image is not working as expected

  • Expected image

    Generating image
    Screenshot from 2019-12-30 11-06-50.png

    QColor color(QColor(r,g,b));
    double rad =10;
    scene->addLine(x y,x+rad, y),QPen(color,100,Qt::SolidLine, Qt::FlatCap,Qt::RoundJoin));

    How to smoothen edges?

  • The two images do not seem to present the same data (e.g. the orange and dark blue areas are completely absent).

    You are adding short horizontal line segments 10 units long and 100 units wide, not points. These will overlay each other and probably not be helping.

    If the data is a point grid then you should draw square "pixels" of the correct size for each point. If the data grid is coarser than the desired result image then you may need to interpolate between adjacent data points to synthesise a smooth pixel grid.

    Are you sure that a QImage is not a better target for this point data?

Log in to reply