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#
  4. How to get points inside polygon

How to get points inside polygon

Scheduled Pinned Locked Moved C#
csharptutorial
9 Posts 5 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.
  • F Offline
    F Offline
    free_soul424
    wrote on last edited by
    #1

    Hi, is it possible to get all the point inside the polygon. Scenario is quite simple; I have created a polygon on panel. Now I want to get all the points inside polygon. Can anyone tell me about any function (win32 or .net library function) or good web link, I will be thankful to you. Regards,

    G M L 3 Replies Last reply
    0
    • F free_soul424

      Hi, is it possible to get all the point inside the polygon. Scenario is quite simple; I have created a polygon on panel. Now I want to get all the points inside polygon. Can anyone tell me about any function (win32 or .net library function) or good web link, I will be thankful to you. Regards,

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      You need all the points inside polygon? I am afraid but you will get OutOfMemoryException :)

      #region signature my articles #endregion

      F 1 Reply Last reply
      0
      • F free_soul424

        Hi, is it possible to get all the point inside the polygon. Scenario is quite simple; I have created a polygon on panel. Now I want to get all the points inside polygon. Can anyone tell me about any function (win32 or .net library function) or good web link, I will be thankful to you. Regards,

        M Offline
        M Offline
        Martin 0
        wrote on last edited by
        #3

        Hello, google search[^] CP article[^]

        All the best, Martin

        1 Reply Last reply
        0
        • G Giorgi Dalakishvili

          You need all the points inside polygon? I am afraid but you will get OutOfMemoryException :)

          #region signature my articles #endregion

          F Offline
          F Offline
          free_soul424
          wrote on last edited by
          #4

          Thanks a lot for you reply. Actually I want to check the mouse enter event for the polygon, I found two ways to check it 1. Check all the polygons coordinates and on mouse move and pick up the source polygon 2. Create a Hashtable of point and their respective polygon object. On every mouse move check that hash. I found 2nd method fast and efficient. I don’t think so it may cause out of memory, what u suggest! Please guide me about the good approach that I should fallow. Regards,

          1 Reply Last reply
          0
          • F free_soul424

            Hi, is it possible to get all the point inside the polygon. Scenario is quite simple; I have created a polygon on panel. Now I want to get all the points inside polygon. Can anyone tell me about any function (win32 or .net library function) or good web link, I will be thankful to you. Regards,

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi, Maybe this is what you need: .NET has a Region class that represents an arbitrary closed shape. And Region.IsVisible() tells you whether a point, rectangle, whatever lies inside the region. BTW: if yours happens to be a web app, then PolygonHotSpot Class might be useful. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


            F 1 Reply Last reply
            0
            • L Luc Pattyn

              Hi, Maybe this is what you need: .NET has a Region class that represents an arbitrary closed shape. And Region.IsVisible() tells you whether a point, rectangle, whatever lies inside the region. BTW: if yours happens to be a web app, then PolygonHotSpot Class might be useful. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


              F Offline
              F Offline
              free_soul424
              wrote on last edited by
              #6

              Hi, it is really great solution, but I don’t think it will work for polygon.... :^)

              C 1 Reply Last reply
              0
              • F free_soul424

                Hi, it is really great solution, but I don’t think it will work for polygon.... :^)

                C Offline
                C Offline
                Colin Angus Mackay
                wrote on last edited by
                #7

                faheem424 wrote:

                it is really great solution, but I don’t think it will work for polygon....

                Why not? Have you tried? What was the result?

                Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

                F 1 Reply Last reply
                0
                • C Colin Angus Mackay

                  faheem424 wrote:

                  it is really great solution, but I don’t think it will work for polygon....

                  Why not? Have you tried? What was the result?

                  Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

                  F Offline
                  F Offline
                  free_soul424
                  wrote on last edited by
                  #8

                  I tried it and it is really working fine. It is good solution. You have really solved the looping cost of my program. Thanks a lot. Regards,

                  L 1 Reply Last reply
                  0
                  • F free_soul424

                    I tried it and it is really working fine. It is good solution. You have really solved the looping cost of my program. Thanks a lot. Regards,

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #9

                    you're welcome. :)

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


                    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