Select to view content in your preferred language

TextSymbol for text graphic

572
1
11-17-2011 07:49 AM
DorothyMortenson
Deactivated User
Hello.
In my application, the user 1) types in a number, 2) puts a dot on the map.

I would like to label the dot with the number they typed in.

I have it mostly working, except I can't seem to change the color (forground). Here is what I have in my C# code:

string textValue = WellNumTxt.Text;
 _textSymbol = new TextSymbol()
    {
                FontFamily = new FontFamily("Arial Black"),
                FontSize = 16,
                OffsetX = -15,
                OffsetY = 23,
                Text = textValue
     };

Graphic graphicText = new Graphic()
            {
                Geometry = new MapPoint(coord_translator.Converted_X , coord_translator.Converted_Y ),
                Symbol = _textSymbol  
            };
            
 graphicsLayer.Graphics.Add(graphicText);



I have tried adding to the _textSymbol:
Forground = "Red",
Forground = new Forground("Red"),
Forground = Red,

I've also tried setting a variable called red and calling the variable.
Forground = color,


Any ideas?
0 Kudos
1 Reply
DorothyMortenson
Deactivated User
Ok, I got it. For one it helps if you can spell.

 Foreground = new SolidColorBrush(Colors.Red),
0 Kudos