How to create a Cross style hatched Symbol

3493
2
08-14-2012 08:58 AM
DaviKucharski
New Contributor II
I am overlaying different types of FillSymbols on my map depending on some values associated to the polygons. Below is how I set up my FillSymbols with LinearGradientBrushes to have a horizontal, diagnol, and vertical lines. I am looking for an example on how to create a FillSymbol that has the Vertical/Horizontal lines so it looks like a cross or checker board design. In the ArcGIS API for Flex it is a simple
 <esri:SimpleFillSymbol id="defaultFillSymbolCross" color="0x000000" alpha="1" style="cross">
     <esri:SimpleLineSymbol color="0x000000" width="2" alpha="1" style="solid" />
 </esri:SimpleFillSymbol> 


Here is my code to create a Vertical and Horizontal:

        private LinearGradientBrush horizontal = new LinearGradientBrush()
        {
            StartPoint = new System.Windows.Point(0, 0),
            EndPoint = new System.Windows.Point(0, 4),
            MappingMode = System.Windows.Media.BrushMappingMode.Absolute,
            SpreadMethod = System.Windows.Media.GradientSpreadMethod.Repeat,
        };


        private LinearGradientBrush vertical = new LinearGradientBrush()
        {
            StartPoint = new System.Windows.Point(0, 0),
            EndPoint = new System.Windows.Point(4, 0),
            MappingMode = System.Windows.Media.BrushMappingMode.Absolute,
            SpreadMethod = System.Windows.Media.GradientSpreadMethod.Repeat,
        };


            FillSymbol model = new FillSymbol();

            GradientStop transparent = new GradientStop();
            transparent.Color = Colors.Transparent;
            transparent.Offset = 0.8;

            GradientStop black = new GradientStop();
            black.Color = Colors.Black;
            black.Offset = 0.8;


                horizontal.GradientStops.Add(transparent);
                horizontal.GradientStops.Add(black);

                model.Fill = horizontal;
-- or --

                vertical.GradientStops.Add(transparent);
                vertical.GradientStops.Add(black);

                model.Fill = vertical;
0 Kudos
2 Replies
wangzhifang
Occasional Contributor
Just look at the symbol gallery here�?http://resources.arcgis.com/en/help/silverlight-api/samples/SymbolGalleryWeb/start.htm
and select the "custom fill symbol", find something useful?
0 Kudos
DaviKucharski
New Contributor II
Thanks but I did see that gallery and was able to produce the horizontal, vertical and diaganol lines. What I am looking for is intersecting lines to look like a checkerboard.

[ATTACH=CONFIG]16970[/ATTACH]

Again, in the api for flex it is a style type, but I don't see the equivalent for silverlight.
0 Kudos