Re: [OpenMap Users] AreaShapeLayer and gradients

From: Don Dietrick <dietrick_at_bbn.com>
Date: Thu, 17 May 2007 11:56:59 -0400

Hi John,

The OMGraphics fill color is actually a fill Paint object, which you
can substitute a java.awt.GradientPaint object that should do what
you want. You'll have to write the code that sets the GradientPaint
on the OMGraphics with the blending you want - choosing the colors
and the point locations of where the the colors are located.

You'll have to set the fill paint after the OMGraphic has been
generated with the projection, so you know where the screen points
are to give to the GradientPaint. That leads me to think you might
want to extend OMPoly to do this for you - so that you can give it a
set of colors and lat/lon locations of neighbors and then override
the generate(Projection) method to figure those points out before
setting the GradiantPaint parameters.

Hope this helps,

Don


On May 17, 2007, at 11:45 AM, Graham, John wrote:

> Hi,
>
> I am working on an application that uses AreaShapeLayer to display
> provinces in Afghanistan. I use the fillcolor property to fill
> each province with a specific color.
>
> No problem there. Now reference http://www.aims.org.af/maps/
> national/political_divisions/political_divisions_34.pdf
> Suppose the “Nimroz” province has a fillcolor of CC99FF and the
> “Hilmand” province has a fillcolor of CCFF33. Now suppose “Farah”
> province has a fillcolor of FFFF33.
>
> What I would like to do is be able to do a gradient color blend
> from one province to the other along the border. In other words,
> there is a blending of colors between adjacent provinces. For
> example, the fillcolor of Nimroz blends into Farah (the two colors
> mix in a gradual gradient blending along the border), and Nimroz
> blends into Hilmand and Farah, and so on. Each province would
> retain its primary fillcolor, but that color would gradually mix
> and blend into the adjacent province as you approach the province
> border. Note that PowerPoint allows you to do this manually this
> when you fill a polygon using a two-color “gradient”.
>
> Any advice on how to approach this in OpenMap?
>
> Thanks,
> John
>
>



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu May 17 2007 - 11:57:17 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT