Regions and GDI+

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.
 
J

Jeff Gaines

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).
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need some graphical advice 6
How to disable regions in Visual Studio? 6
GDI+ Error on Bitmap Save 1
GDI Color Depth 1
GDI color depth? 5
Image Regions 1
Auto duplicating regions? 7
Regions of Constant Slope 1

Top