Re: click inside a region

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The only problem of "different colors" is that (a) there are 261 different regions,
according the NLS support in Windows and (b) the human eye/brain combination is not going
to make the subtle distinctions unless there is physical adjacency. So while lots of
colors is a cool idea, it may not make practical sense from a presentational viewpoint.

And if this is ever going international, there are subtler problems. Like, where *is* the
border between Pakistan and India? (in a recent Air India flight I was on, for the
in-flight map, they only showed physical features on the map, such as mountain chains, and
kept flashing up a reminder that "this map shows physical features, not political
boundaries"). And what if the country you showed in a particular color has a culture that
believes that color *actually* represents (a) the color of evil (b) the favorite color of
the deposed dictator/military/liberal/conservative regime (c) the color-of-joy of the
rebels they are trying to suppress (d) the color-of-joy of their adjoining enemy country
(e) the representative color of the colonialists they broke free from a half-century ago
(f) the color of the large bills caused by the hyperinflation (g) the color of the
exploitive corporate plutocrats who have stolen all the land and kept the rest of the
population poor (h) offensive for some other reason we cannot understand unless we are
part of that culture?

Simple example: in China, red is the color of joy, and white the color of mourning. So a
flashing red text would mean good tidings, and a white window background would mean, well,
probably that they were trying to upgrade from VS6 to VS2008.
joe

On Fri, 3 Jul 2009 07:26:45 +0100, "David Webber" <dave@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:



"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:a5ip451ftc9rpvqahqpm9l87ph1t6ndh0m@xxxxxxxxxx

I would consider the only sane representation to be the vector format
representation; as
you point out, it can be scaled.

Unfortunately, for various projections (e.g., the classic Mercator map)
the scaling is
quite nonlinear, but the formulas are centuries old. There's probably a
set of Web sites
devoted to the math.

For a fixed projection, the transformation is easily precomputed, or could
be built into
the vector representation.

I hadn't interpreted the OP's problem as necessarily one of creating
specifically a map of the globe. But if so, yes, the underlying vector data
could be stored as coordinates on the globe, or as coordinates on the map.
The first would have the advantage that different projections could be
applied at the stage where the bitmap is created. It's a while since I
looked at them but IIRC standard projections like Mercator are not
particularly complicated.

FillRgn can be used to fill an arbitrary region, and PtInRgn can be used
for hit testing.
Much simpler than the bitmap manipulation.

However, note that even with a "limited" number of colors selected, a
"red" or "green" or
"yellow" or "blue" map element can be made different from other "red" or
"green" or
"yellow" or "blue" map elements of nominally the same color by tweaking
the low-order bit
of one of the color components. Thus, while yellow is nominally RGB(255,
255, 0), most
displays will show a yellow which is visually indistinguishable except it
might be
RGB(254, 255, 0), RGB(255, 254, 0), RGB(254, 254, 0) or repeat all of the
preceding with
RGB(r, g, 1) for the aforementioned values of r and g. This can be
repeated for a fairly
large range, probably up to 5, without creating colors that look distinct.
So the pixel
hack *can* work, but it still makes sense to have the basic representation
as vectors.

I was imagining use of a visibly different colour for each region - much
prettier :-)

Dave
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: click inside a region
    ... Unfortunately, for various projections (e.g., the classic Mercator map) the scaling is ... the vector representation. ... I hadn't interpreted the OP's problem as necessarily one of creating specifically a map of the globe. ... The first would have the advantage that different projections could be applied at the stage where the bitmap is created. ...
    (microsoft.public.vc.mfc)
  • Re: click inside a region
    ... to make the subtle distinctions unless there is physical adjacency. ... That's why I thought that the color map will be in an off-screen DC (so I ... Unfortunately, for various projections ... the vector representation. ...
    (microsoft.public.vc.mfc)
  • Re: hello?
    ... of the brain's representation of the physical act. ... map that counts and indeed is all we have. ... internal "map" of the environment. ... chain of internal behaviors. ...
    (comp.ai.philosophy)
  • Re: hello?
    ... of the brain's representation of the physical act. ... map that counts and indeed is all we have. ... can study a car with a microscope and learn all sorts of stuff about the ... internal map to guide the actions of the machine (like route planing ...
    (comp.ai.philosophy)
  • Re: is there a way to print a procedure name?
    ... Although STk is more informative when it comes to user-defined lambda ... STk> (lambda (foo bar baz) 1) ... the procedure if it is a primitive (that is, + for +, map for map, and ... I haven't really cared what the internal representation ...
    (comp.lang.scheme)