Regions and GDI+

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everybody.

What is a general way to code the application that has some regions and
needs to do the hit testing. Say, for example, I have a bitmap that shows the
United States, now I want to be able to display a message showing the name of
the selected State. Or, I increase or decrease the size of the bitmap, I want
to be able to do the same. Is the easiest way to process a bitmap to get the
paths of state borders, or there is a better way for hit testing of irregular
shapes.

Thanks.
 
Hi everybody.

What is a general way to code the application that has some regions
and needs to do the hit testing. Say, for example, I have a bitmap
that shows the United States, now I want to be able to display a
message showing the name of the selected State. Or, I increase or
decrease the size of the bitmap, I want to be able to do the same. Is
the easiest way to process a bitmap to get the paths of state
borders, or there is a better way for hit testing of irregular shapes.


Could you use a different colour for each State and test for the colour
on mouse down? (assuming you can find a set of colours that won't start
an inter-State war, but there's around 140 colours I think).
 
Yes, I could do that, however then I can not have anything other on that
region, i.e. that state would have to be only one color. You could not even
put any letters or such on it, cause what if the user clicks on the font
which is a different color?
 
Back
Top