Re: click inside a region

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





"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
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

.



Relevant Pages

  • Re: click inside a region
    ... according the NLS support in Windows and the human eye/brain combination is not going ... Unfortunately, for various projections (e.g., the classic Mercator map) ... the vector representation. ...
    (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)