No announcement yet.

Location on a bitmap

  • Filter
  • Time
  • Show
Clear All
new posts

  • Location on a bitmap

    Using PB/DLL...

    I have a large bitmap that takes up the whole
    window and displays a map of the USA.

    How can I have my program respond when the user
    left-clicks on a particular state...say 'Arizona'?

    Would I have to create 'hidden' bitmaps, or buttons?


    "It was too lonely at the top".

  • #2
    Bob --
    You can take coordinates from WM_LBUTTONDOWN message.

    But I guess that you have a scanned map.
    If so, to recognize a state, you need to have a table (x, y, state).
    Because I am doubt that you can prepare similar table, alone, what I can suggest - to color each state (incl. title) by unique RGB and to analyze a color by GetPixel.

    Note, that with this approach some states can have the same color for eyes -
    for example, RGB(0, 0, 128) and RGB(0, 0, 129)

    E-MAIL: [email protected]