Hello
I set a custom text style to my map, How can I define the background color of the text?
TextValueStyleDefault = new ValueStyle();
TextValueStyleDefault.ColumnName = "name";
TextStyleDefault = new TextStyle("name", new GeoFont("Arial", 20, DrawingFontStyles.Regular), new GeoSolidBrush(GeoColor.SimpleColors.Black));
layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextValueStyleDefault );
Thank you
Text background color
Hi Miri,
Does this what you want?
ValueItem item = new ValueItem("Your Value", YourTextStyle);
Collection<ValueItem> valueItems = new Collection<ValueItem>();
valueItems.Add(item);
ValueStyle TextValueStyleDefault = new ValueStyle("ColumnName", valueItems);
Regards,
Don
sorry, I will try to be more specific
when creating new TextStyle object, I can see that the text color is defined by GeoSolidBrush.
But I do not understand how to set the background color of the Text (there is no appropriate parameter in the TextStyle constractor)
TextStyle YourTextStyle= new TextStyle("name", new GeoFont("Arial", 20, DrawingFontStyles.Regular), new GeoSolidBrush(GeoColor.SimpleColors.Black));
Thank you
Hi Miri,
I have a little confused about your question.
Because our textStyle mainly work for label, it don’t have a background.
Do you meant something like this image? You want to set the color like the green area?
If that’s what you want, please set the “Mask” property for your textStyle, or you can also try the “HaloPen” property.
Regards,
Don
Yes thank you, that is exactly what i needed
Hi Miri,
Please let us know if any other question.
Thanks,
Troy