Results 1 to 2 of 2

Thread: [RESOLVED] calculating columnIndex, rowIndex from point

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,414

    Resolved [RESOLVED] calculating columnIndex, rowIndex from point

    i have a picturebox that has a hexagon grid drawn on it:

    Name:  28-09-2012 17.10.58.jpg
Views: 156
Size:  51.1 KB

    at runtime, as i move my mouse over the picturebox, i want to calculate the columnIndex + rowIndex that contains the mousePointer.

    the cells are hexagonal 25 pixels wide * 23 pixels tall.

    these are the polygon points that describe a cell:

    Dim points() As Point = {New Point(12, 0), New Point(25, 5), New Point(25, 18), New Point(12, 23), New Point(0, 18), New Point(0, 5)}

    to draw the grid, i use the array of points for each cell, with an offset.
    thanks for any help
    Last edited by .paul.; Sep 28th, 2012 at 11:19 AM.

  2. #2

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,414

    Re: calculating columnIndex, rowIndex from point

    nevermind... i resolved it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width