Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Adding polygon

Adding polygon

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 4 Posters 0 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.
  • J Offline
    J Offline
    JGranborg
    wrote on last edited by
    #1

    I am going to draw some polygons with borders and filled with a color. From time to time I have to draw a border around two adjacent polygons. Any suggestions to algoritms. I have tried making two regions and combining these but when I draw the frame it makes a frame around the polygons I like to have the border in the edge of the polygons. thanks a lot

    A C S 3 Replies Last reply
    0
    • J JGranborg

      I am going to draw some polygons with borders and filled with a color. From time to time I have to draw a border around two adjacent polygons. Any suggestions to algoritms. I have tried making two regions and combining these but when I draw the frame it makes a frame around the polygons I like to have the border in the edge of the polygons. thanks a lot

      A Offline
      A Offline
      Anders Molin
      wrote on last edited by
      #2

      Maybe I don't understant what you mean, but have you looed at PolyPolygon()? - Anders Money talks, but all mine ever says is "Goodbye!"

      J 1 Reply Last reply
      0
      • J JGranborg

        I am going to draw some polygons with borders and filled with a color. From time to time I have to draw a border around two adjacent polygons. Any suggestions to algoritms. I have tried making two regions and combining these but when I draw the frame it makes a frame around the polygons I like to have the border in the edge of the polygons. thanks a lot

        C Offline
        C Offline
        ColinDavies
        wrote on last edited by
        #3

        The other way to work is to consider building your polygon in reverse, by clipping out the areas that are not wanted anymore. Regardz Colin J Davies

        Sonork ID 100.9197:Colin

        I'm guessing the concept of a 2 hour movie showing two guys eating a meal and talking struck them as 'foreign' Rob Manderson wrote:

        J 1 Reply Last reply
        0
        • A Anders Molin

          Maybe I don't understant what you mean, but have you looed at PolyPolygon()? - Anders Money talks, but all mine ever says is "Goodbye!"

          J Offline
          J Offline
          JGranborg
          wrote on last edited by
          #4

          I have tried, but this funktion draws the lines they have in common, i want to draw a border around the new polygon combined polygon. Thanks anyway Jørgeen Granbog

          1 Reply Last reply
          0
          • J JGranborg

            I am going to draw some polygons with borders and filled with a color. From time to time I have to draw a border around two adjacent polygons. Any suggestions to algoritms. I have tried making two regions and combining these but when I draw the frame it makes a frame around the polygons I like to have the border in the edge of the polygons. thanks a lot

            S Offline
            S Offline
            Scott H Settlemier
            wrote on last edited by
            #5

            You mean you have two polygons with non 0 intersection and you'd like the union of those? Did you use CombineRgn with RGN_OR and then FrameRgn? Or do you want the smallest single polygon cover? (i.e. no holes)

            J 1 Reply Last reply
            0
            • S Scott H Settlemier

              You mean you have two polygons with non 0 intersection and you'd like the union of those? Did you use CombineRgn with RGN_OR and then FrameRgn? Or do you want the smallest single polygon cover? (i.e. no holes)

              J Offline
              J Offline
              JGranborg
              wrote on last edited by
              #6

              Yes 2 polygons with one or 2 adjacent sides. The problem with Regions is that when I use FrameRgn, I get a Frame around the region, and just want to display the edge. The problem is that I have som schematic teeths, divided into 5 polygons one center, with four surrounding polygons. You can have a defect in two adjacent polygons og just in one polygon. When you have it in one polygon you have a frame around the polygon surrounding this polygon with a color inside indication the material the defect is filled with. When the defect extend into two polygons the I want to have a frame around both polygons filled with a color. I might extend it to the hole teeth. Thanks for your interest

              1 Reply Last reply
              0
              • C ColinDavies

                The other way to work is to consider building your polygon in reverse, by clipping out the areas that are not wanted anymore. Regardz Colin J Davies

                Sonork ID 100.9197:Colin

                I'm guessing the concept of a 2 hour movie showing two guys eating a meal and talking struck them as 'foreign' Rob Manderson wrote:

                J Offline
                J Offline
                JGranborg
                wrote on last edited by
                #7

                Thanks that might be a good suggestion - I looked for an algorithm. Else I will try to handle it this way. Thanks for your interest Jørgen Granborg

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups