473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Regions and GDI+

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.
Nov 30 '05 #1
2 1062
On 30/11/2005 Mirano wrote:
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).

--
Jeff Gaines
Nov 30 '05 #2
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?

"Jeff Gaines" wrote:
On 30/11/2005 Mirano wrote:
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).

--
Jeff Gaines

Dec 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: C# Learner | last post by:
1) How often do you put regions into your code? a) very often b) occasionally c) infrequently d) never 2) If you didn't answer (d), what do you use regions for? a) hiding ugly code
4
by: Simon | last post by:
Just starting on C# and would like to know what suggestions there are for the order in which declarations, event handlers, properties, private code, nested classes, etc, etc appear in your files....
6
by: James dean | last post by:
I have heard that the video drivers in GDI+ are a big performance issue. But is this only an issue with something like Games Programming i think...is this wrong?. What about a drawing application...
1
by: James dean | last post by:
Could someone explain how this works. I think the graphics card is used to do blitting and drawing shapes like rectangles. How does it draw using the Graphics card on the PC and why is this feature...
6
by: James dean | last post by:
I want a good site that will show clearly how much more functionality GDI+ has. I cannot seem to find anything other than sites that list "some" of the new functionality that GDI+ offers. A...
7
by: | last post by:
We create VC++ programs that does some GDI drawing functionality. I discovered GDI+ and this seems to be a big step forward, and appears to be standard available in Windows XP and Windows Server...
7
by: Marcin Rzeznicki | last post by:
Hello, Do you think it is legitimate practice to mix GDI+ and GDI calls (via Get/ReleaseHDC()) in paint event of a control? I've heard there is possibility of performance loss while "locking"...
6
by: Ikke | last post by:
Hi everybody, Can somebody tell me how to disable regions in Visual Studio 2005? I've already told VS not to collapse code to regions in the settings, but each time I open a new (existing)...
8
by: Spleenwort | last post by:
With regard to XML comments in c#. I think that #regions should be self-documenting relative to XML comments or that a <region> tag should be defined and auto-inserted when you type #region...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.