Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Graphics scene add point for generate image is not working as expected
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 173 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sujith D
    wrote on last edited by
    #1

    Expected image
    2153cb33-6d54-4fdf-bd66-ad14464db44d.jpeg

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

    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?
    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved