Select to view content in your preferred language

Colorramp in arcgis wpf ???

1050
5
02-18-2011 08:39 AM
ThaoNguyen
Emerging Contributor
I have a properties dialog that let user select a theme color and based on the theme that I generate colors which will be applied to different regions of a map.

Before, we use arcgis 9.3 api, there are ESRI.ArcGIS.Display.IEnumColors class that can generate colors for us.  Now, we are using arcgis wpf apis only, is there a similar class that achieve the same work?

Code example of what we did:

IColorRamp colorRamp = ColorRampInstance;
colorRamp.Size = 5
bool ok = true;
colorRamp.CreateRamp(out ok);

IEnumColors enumRamp = colorRamp.Colors;
IColor nextUniqueColor = enumRamp.Next();

How can we achieve the same thing using arcgis wpf apis?

Thanks!
0 Kudos
5 Replies
JenniferNery
Esri Regular Contributor
Do you mean interpolate color of graphic symbols in your map?

If yes you can refer to these samples:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TemporalRendererPoints
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TemporalRendererTracks

Note TemporalRenderer.SymbolAger in above samples use RampInterpolator by Opacity, this can also been done by Color. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.RampInterp...
0 Kudos
ThaoNguyen
Emerging Contributor
Do you mean interpolate color of graphic symbols in your map?

If yes you can refer to these samples:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TemporalRendererPoints
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TemporalRendererTracks

Note TemporalRenderer.SymbolAger in above samples use RampInterpolator by Opacity, this can also been done by Color. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.RampInterp...


Thanks for the quick response.  I think it is color interpolate but samples you gave are not quite what I'm looking for.

Each of my theme has 3 basic colors.  I pass these colors to IColorRamp.  If my map has 10 regions, I want to have 10 colors generated based on my theme applied to the regions.  IColorRamp does this for me, it will generate the colors for me.  Then, I apply these colors to my map (I know how to do this part).  I wonder if arcgis wpf provides me some color "generator" like IColorRamp or not.
0 Kudos
ThaoNguyen
Emerging Contributor
Attached is a map with different colors applied to different regions.  These colors are generated by IColorRamp based on the theme colors I pass in.  Hope this helps.
0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos
ThaoNguyen
Emerging Contributor
Ah I see. You can refer to this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Thematic_Interactive.

This other sample use ClassBreaksRenderer: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerRendering


The first example is not quite what I'm looking for either because it uses only 1 basic color while I have 3.
I just want to know if arcgis wpf provides a quick way like arcgis desktop api does.
Thanks for your effort!
0 Kudos