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. I want to know the total size of a shape drawn with Painter.
Qt 6.11 is out! See what's new in the release blog

I want to know the total size of a shape drawn with Painter.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 268 Views 1 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by Pada_
    #1

    Hi everyone

    I'm using Linux 64Bit, Qt 5.4.0.

    Using the Painter's DrawPolygon, inside a rectangle of size from QPoint(0,0) to QPoint(100,100)
    I drew my brother.

    When the width of the pen is 1, it is drawn just inside the rectangular area, but when it is 10, it is drawn outside the area because it is thick.

    Can you know the entire area to be drawn?

    e3277fb2-d1af-4335-8ec4-73b303f34915-image.png

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      line drawing with width greater than one should average the line on both sides of the line's formula. (half inside, and half outside). Calculating the space inside the polygon is a math problem left as an exercise for you.

      The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

      1 Reply Last reply
      1

      • Login

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