# How do I assign colors to each shape

**URL:** <https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600>\
**Category:** WPF\
**Created:** [January 15, 2014, 11:56am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600 "2014-01-15T11:56:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@Scott1](https://community.thinkgeo.com/u/Scott1)\
**Post date:** [January 15, 2014, 11:56am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/1 "2014-01-15T11:56:57Z")

</div>

I&nbsp;am&nbsp;working&nbsp;on&nbsp;the&nbsp;drawing&nbsp;tools&nbsp;piece&nbsp;and&nbsp;I&nbsp;am&nbsp;looking&nbsp;for&nbsp;a&nbsp;way&nbsp;to&nbsp;allow&nbsp;the&nbsp;user&nbsp;to&nbsp;set&nbsp;the&nbsp;color&nbsp;for&nbsp;each&nbsp;item&nbsp;they&nbsp;are&nbsp;drawing&nbsp;as&nbsp;well&nbsp;as&nbsp;line&nbsp;size&nbsp;and&nbsp;other&nbsp;things.&nbsp;I&nbsp;was&nbsp;thinking&nbsp;that&nbsp;a&nbsp;way&nbsp;to&nbsp;do&nbsp;this&nbsp;could&nbsp;be&nbsp;using&nbsp;the&nbsp;columns&nbsp;and&nbsp;add&nbsp;these&nbsp;attributes&nbsp;to&nbsp;the&nbsp;database.&nbsp;That&nbsp;is&nbsp;as&nbsp;far&nbsp;as&nbsp;I&nbsp;got.&nbsp;I&nbsp;don’t&nbsp;know&nbsp;how&nbsp;I&nbsp;would&nbsp;apply&nbsp;this&nbsp;in&nbsp;a&nbsp;style.  
  
  
  
Any&nbsp;suggestions?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 15, 2014, 8:58pm UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/2 "2014-01-15T20:58:12Z")

</div>

Hi&nbsp;Scott,&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;put&nbsp;all&nbsp;features&nbsp;in&nbsp;same&nbsp;layer,&nbsp;you&nbsp;can&nbsp;set&nbsp;your&nbsp;valueStyle&nbsp;and&nbsp;dynamic&nbsp;add&nbsp;ValuItem&nbsp;to&nbsp;valueStyle.ValueItems.&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;can&nbsp;use&nbsp;featureID&nbsp;as&nbsp;value&nbsp;of&nbsp;ValueItem,&nbsp;if&nbsp;user&nbsp;modify&nbsp;the&nbsp;feature,&nbsp;find&nbsp;corresponding&nbsp;ValueItem&nbsp;in&nbsp;collection,&nbsp;and&nbsp;replace&nbsp;its&nbsp;style.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;it&nbsp;should&nbsp;works.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Does&nbsp;save&nbsp;to&nbsp;database&nbsp;necessary&nbsp;in&nbsp;your&nbsp;scenario?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Scott1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@Scott1](https://community.thinkgeo.com/u/Scott1)\
**Post date:** [January 16, 2014, 10:09am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/3 "2014-01-16T10:09:04Z")

</div>

Hello&nbsp;Don,  
  
I&nbsp;am&nbsp;not&nbsp;sure&nbsp;if&nbsp;saving&nbsp;to&nbsp;the&nbsp;database&nbsp;would&nbsp;be&nbsp;necessary,&nbsp;we&nbsp;are&nbsp;saving&nbsp;the&nbsp;drawing&nbsp;to&nbsp;a&nbsp;shape&nbsp;file&nbsp;and&nbsp;loading&nbsp;it&nbsp;back&nbsp;next&nbsp;time&nbsp;the&nbsp;app&nbsp;is&nbsp;run.&nbsp;Using&nbsp;ValueItems&nbsp;can&nbsp;I&nbsp;still&nbsp;do&nbsp;this?&nbsp;Next&nbsp;time&nbsp;the&nbsp;app&nbsp;is&nbsp;run&nbsp;where&nbsp;would&nbsp;the&nbsp;style&nbsp;info&nbsp;come&nbsp;from?&nbsp;Do&nbsp;you&nbsp;have&nbsp;any&nbsp;examples&nbsp;of&nbsp;using&nbsp;value&nbsp;items?&nbsp;  
  
  
  
Thanks,&nbsp;  
  
  
  
Scott

---

<div class="post-metadata">

**Author:** ![Scott1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@Scott1](https://community.thinkgeo.com/u/Scott1)\
**Post date:** [January 16, 2014, 5:36pm UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/4 "2014-01-16T17:36:23Z")

</div>

Hi&nbsp;Don,&nbsp;  
  
I&nbsp;ran&nbsp;into&nbsp;another&nbsp;thing&nbsp;while&nbsp;working&nbsp;on&nbsp;this.&nbsp;I&nbsp;have&nbsp;a&nbsp;custom&nbsp;line&nbsp;style&nbsp;added&nbsp;to&nbsp;my&nbsp;map&nbsp;and&nbsp;things&nbsp;sort&nbsp;of&nbsp;work.&nbsp;The&nbsp;problem&nbsp;I&nbsp;am&nbsp;having&nbsp;is,&nbsp;when&nbsp;I&nbsp;first&nbsp;start&nbsp;drawing&nbsp;a&nbsp;line&nbsp;I&nbsp;get&nbsp;the&nbsp;default&nbsp;blue&nbsp;line&nbsp;showing&nbsp;me&nbsp;where&nbsp;I&nbsp;am&nbsp;drawing.&nbsp;After&nbsp;I&nbsp;finish&nbsp;drawing&nbsp;a&nbsp;line&nbsp;and&nbsp;the&nbsp;DrawEnded&nbsp;event&nbsp;fires&nbsp;I&nbsp;set&nbsp;the&nbsp;custom&nbsp;style.&nbsp;Now&nbsp;the&nbsp;next&nbsp;line&nbsp;I&nbsp;start&nbsp;to&nbsp;draw&nbsp;has&nbsp;no&nbsp;visible&nbsp;line&nbsp;showing&nbsp;me&nbsp;where&nbsp;I&nbsp;am&nbsp;drawing,&nbsp;even&nbsp;though&nbsp;when&nbsp;I&nbsp;double&nbsp;click&nbsp;to&nbsp;terminate&nbsp;the&nbsp;line&nbsp;it&nbsp;will&nbsp;then&nbsp;show&nbsp;the&nbsp;line&nbsp;I&nbsp;just&nbsp;finished&nbsp;drawing.  
  
  
  
Any&nbsp;idea&nbsp;where&nbsp;the&nbsp;line&nbsp;has&nbsp;gone?

> `GranularStyle lineStyle = ``new`&nbsp;`GranularStyle();`  
> `lineStyle.RequiredColumnNames.Add(``"Width"``);`  
> `lineStyle.RequiredColumnNames.Add(``"Color"``);`  
> `defaultZoomLevel.CustomStyles.Add(lineStyle);`  
> `defaultZoomLevel.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;`

  
  
  

> `public`&nbsp;`class`&nbsp;`GranularStyle : LineStyle`  
> `    ``{`  
> `        ``protected`&nbsp;`override`&nbsp;`void`&nbsp;`DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInAllLayers)`  
> `        ``{`  
> `            ``double`&nbsp;`customWidth = 1;`  
> `            ``int`&nbsp;`customOpacity = 255;`  
> `            ``GeoColor customColor = GeoColor.SimpleColors.Red;`  
> `            ``foreach`&nbsp;`(Feature feature ``in`&nbsp;`features)`  
> `            ``{`  
> `                ``double`&nbsp;`width;`  
> `               ``if`&nbsp;`(``double``.TryParse(feature.ColumnValues[``"Width"``], ``out`&nbsp;`width))`  
> `               ``{`  
> `                   ``customWidth = width;`  
> `               ``}`  
> `                ``//customOpacity = (int)(Convert.ToInt32(feature.ColumnValues["Opacity"]) * 2.55);`  
> `               ``if`&nbsp;`(feature.ColumnValues.Any(a => a.Key == ``"Color"``) && `  
> `                   ``!``string``.IsNullOrEmpty(feature.ColumnValues.First(b => b.Key == ``"Color"``).Value))`  
> `                ``{`  
> `                    ``customColor = GeoColor.FromHtml(feature.ColumnValues[``"Color"``]);`  
> `                ``}`  
> &nbsp;  
> `                    ``canvas.DrawLine(feature,`  
> `                                    ``new`&nbsp;`GeoPen(GeoColor.FromArgb(customOpacity, customColor), (``float``)customWidth),`  
> `                                    ``DrawingLevel.LabelLevel);`  
> `               `&nbsp;  
> `            ``}`  
> `        ``}`  
> `    ``}`

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 17, 2014, 3:31am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/5 "2014-01-17T03:31:18Z")

</div>

`Posted By Scott on 01-16-2014 10:09 AMHello Don,I am not sure if saving to the database would be necessary, we are saving the drawing to a shape file and loading it back next time the app is run. Using ValueItems can I still do this? Next time the app is run where would the style info come from? Do you have any examples of using value items? Thanks, Scott`  
  
Hi&nbsp;Scott,  
  
  
  
I&nbsp;ask&nbsp;about&nbsp;database&nbsp;because&nbsp;you&nbsp;mentioned&nbsp;that&nbsp;in&nbsp;your&nbsp;first&nbsp;post.&nbsp;I&nbsp;think&nbsp;save&nbsp;to&nbsp;shape&nbsp;file&nbsp;and&nbsp;load&nbsp;back&nbsp;is&nbsp;ok.  
  
  
  
How&nbsp;to&nbsp;render&nbsp;it&nbsp;is&nbsp;not&nbsp;related&nbsp;how&nbsp;to&nbsp;save&nbsp;it.&nbsp;So&nbsp;please&nbsp;don’t&nbsp;worry&nbsp;about&nbsp;that.  
  
  
  
Here&nbsp;we&nbsp;have&nbsp;a&nbsp;sample&nbsp;about&nbsp;ValueStyle,&nbsp;please&nbsp;view&nbsp;it.  
  
[wiki.thinkgeo.com/wiki/Sourc…110218.zip](http://wiki.thinkgeo.com/wiki/Source_Code_WpfEditionSample_DefaultValueStyle_CS_110218.zip)  
  
  
  
Regards,  
  
  
  
Don

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 17, 2014, 3:34am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/6 "2014-01-17T03:34:46Z")

</div>

`Posted By Scott on 01-16-2014 05:36 PMHi Don, I ran into another thing while working on this. I have a custom line style added to my map and things sort of work. The problem I am having is, when I first start drawing a line I get the default blue line showing me where I am drawing. After I finish drawing a line and the DrawEnded event fires I set the custom style. Now the next line I start to draw has no visible line showing me where I am drawing, even though when I double click to terminate the line it will then show the line I just finished drawing.Any idea where the line has gone?`

> `GranularStyle lineStyle = new GranularStyle();lineStyle.RequiredColumnNames.Add("Width");lineStyle.RequiredColumnNames.Add("Color");defaultZoomLevel.CustomStyles.Add(lineStyle);defaultZoomLevel.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;`

`public class GranularStyle : LineStyle    {        protected override void DrawCore(IEnumerable<feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<simplecandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<simplecandidate> labelsInAllLayers)        {            double customWidth = 1;            int customOpacity = 255;            GeoColor customColor = GeoColor.SimpleColors.Red;            foreach (Feature feature in features)            {                double width;               if (double.TryParse(feature.ColumnValues["Width"], out width))               {                   customWidth = width;               }                //customOpacity = (int)(Convert.ToInt32(feature.ColumnValues["Opacity"]) * 2.55);               if (feature.ColumnValues.Any(a => a.Key == "Color") &&                    !string.IsNullOrEmpty(feature.ColumnValues.First(b => b.Key == "Color").Value))                {                    customColor = GeoColor.FromHtml(feature.ColumnValues["Color"]);                }                     canvas.DrawLine(feature,                                    new GeoPen(GeoColor.FromArgb(customOpacity, customColor), (float)customWidth),                                    DrawingLevel.LabelLevel);                            }        }    }`Hi&nbsp;Scott,  
  
  
  
Sorry&nbsp;I&nbsp;haven’t&nbsp;found&nbsp;problem&nbsp;in&nbsp;your&nbsp;code&nbsp;snippet.&nbsp;I&nbsp;think&nbsp;TrackOverlay&nbsp;won’t&nbsp;related&nbsp;with&nbsp;your&nbsp;custom&nbsp;style,&nbsp;because&nbsp;you&nbsp;should&nbsp;move&nbsp;your&nbsp;feature&nbsp;to&nbsp;your&nbsp;own&nbsp;layer&nbsp;after&nbsp;track&nbsp;end&nbsp;each&nbsp;time.&nbsp;And&nbsp;your&nbsp;custom&nbsp;style&nbsp;should&nbsp;works&nbsp;for&nbsp;your&nbsp;own&nbsp;layer&nbsp;only.  
  
  
  
Could&nbsp;you&nbsp;please&nbsp;create&nbsp;a&nbsp;really&nbsp;simple&nbsp;sample&nbsp;which&nbsp;can&nbsp;reproduce&nbsp;this&nbsp;problem&nbsp;so&nbsp;that&nbsp;I&nbsp;can&nbsp;help&nbsp;you&nbsp;find&nbsp;the&nbsp;problem?  
  
  
  
Regards,  
  
  
  
Don

---

<div class="post-metadata">

**Author:** ![Scott1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@Scott1](https://community.thinkgeo.com/u/Scott1)\
**Post date:** [January 17, 2014, 10:33am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/7 "2014-01-17T10:33:49Z")

</div>

Hi&nbsp;Don,&nbsp;thank&nbsp;you&nbsp;for&nbsp;your&nbsp;reply.&nbsp;I&nbsp;had&nbsp;a&nbsp;look&nbsp;at&nbsp;the&nbsp;value&nbsp;style&nbsp;piece&nbsp;and&nbsp;it&nbsp;looks&nbsp;like&nbsp;you&nbsp;can&nbsp;have&nbsp;multiple&nbsp;preset&nbsp;styles&nbsp;that&nbsp;are&nbsp;applied&nbsp;to&nbsp;different&nbsp;things,&nbsp;but&nbsp;it&nbsp;does&nbsp;not&nbsp;seam&nbsp;that&nbsp;I&nbsp;can&nbsp;have&nbsp;dynamic&nbsp;ones.&nbsp;One&nbsp;of&nbsp;my&nbsp;requirements&nbsp;are,&nbsp;the&nbsp;user&nbsp;has&nbsp;a&nbsp;color&nbsp;wheel&nbsp;and&nbsp;is&nbsp;able&nbsp;to&nbsp;select&nbsp;any&nbsp;color&nbsp;and&nbsp;apply&nbsp;it&nbsp;to&nbsp;the&nbsp;line&nbsp;being&nbsp;drawn.&nbsp;So&nbsp;that&nbsp;would&nbsp;be&nbsp;far&nbsp;to&nbsp;many&nbsp;colors&nbsp;to&nbsp;make&nbsp;predefined&nbsp;styles&nbsp;for.  
  
  
  
As&nbsp;for&nbsp;the&nbsp;other&nbsp;issue&nbsp;I&nbsp;was&nbsp;having&nbsp;I&nbsp;can&nbsp;try&nbsp;moving&nbsp;the&nbsp;drawn&nbsp;item&nbsp;to&nbsp;my&nbsp;own&nbsp;layer,&nbsp;but&nbsp;it&nbsp;would&nbsp;have&nbsp;been&nbsp;nice&nbsp;for&nbsp;the&nbsp;preview&nbsp;line&nbsp;being&nbsp;drawn&nbsp;could&nbsp;reflect&nbsp;the&nbsp;color&nbsp;the&nbsp;user&nbsp;has&nbsp;chosen&nbsp;from&nbsp;the&nbsp;color&nbsp;wheel.&nbsp;.  
  
  
  
Also&nbsp;with&nbsp;the&nbsp;custom&nbsp;style&nbsp;I&nbsp;put&nbsp;above&nbsp;even&nbsp;though&nbsp;it&nbsp;is&nbsp;a&nbsp;line&nbsp;style&nbsp;when&nbsp;using&nbsp;the&nbsp;drawing&nbsp;tools&nbsp;and&nbsp;I&nbsp;try&nbsp;and&nbsp;draw&nbsp;a&nbsp;polygon&nbsp;it&nbsp;will&nbsp;crash&nbsp;because&nbsp;my&nbsp;style&nbsp;is&nbsp;a&nbsp;line&nbsp;style.&nbsp;Now&nbsp;I&nbsp;assume&nbsp;I&nbsp;also&nbsp;need&nbsp;to&nbsp;create&nbsp;another&nbsp;custom&nbsp;style&nbsp;that&nbsp;inherits&nbsp;AreaStyle.&nbsp;Is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;make&nbsp;this&nbsp;work?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 19, 2014, 11:59pm UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/8 "2014-01-19T23:59:58Z")

</div>

Hi&nbsp;Scott,&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;used&nbsp;to&nbsp;render&nbsp;shape&nbsp;by&nbsp;preset&nbsp;styles,&nbsp;but&nbsp;you&nbsp;can&nbsp;try&nbsp;getting&nbsp;the&nbsp;style&nbsp;back&nbsp;and&nbsp;set&nbsp;value&nbsp;to&nbsp;it&nbsp;dynamic.&nbsp;We&nbsp;can&nbsp;try&nbsp;to&nbsp;find&nbsp;another&nbsp;solution&nbsp;if&nbsp;that&nbsp;don’t&nbsp;works&nbsp;there.&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;your&nbsp;another&nbsp;issue,&nbsp;I&nbsp;haven’t&nbsp;reproduced&nbsp;it&nbsp;via&nbsp;your&nbsp;code&nbsp;snippet,&nbsp;so&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;how&nbsp;it&nbsp;looks&nbsp;like&nbsp;for&nbsp;now.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;support&nbsp;area&nbsp;shape,&nbsp;please&nbsp;create&nbsp;spearated&nbsp;area&nbsp;style,&nbsp;and&nbsp;add&nbsp;that&nbsp;to&nbsp;custom&nbsp;style.&nbsp;And&nbsp;I&nbsp;think&nbsp;put&nbsp;area&nbsp;style&nbsp;to&nbsp;a&nbsp;single&nbsp;layer&nbsp;is&nbsp;better.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Scott1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@Scott1](https://community.thinkgeo.com/u/Scott1)\
**Post date:** [January 22, 2014, 6:39pm UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/9 "2014-01-22T18:39:51Z")

</div>

Hi&nbsp;Don,&nbsp;I&nbsp;have&nbsp;been&nbsp;making&nbsp;progress&nbsp;with&nbsp;this&nbsp;issue,&nbsp;but&nbsp;another&nbsp;thing&nbsp;that&nbsp;has&nbsp;come&nbsp;up,&nbsp;is&nbsp;on&nbsp;a&nbsp;style&nbsp;like&nbsp;the&nbsp;sample&nbsp;above,&nbsp;I&nbsp;am&nbsp;using&nbsp;canvas.DrawTextWithWorldCoordinate()&nbsp;method&nbsp;to&nbsp;add&nbsp;the&nbsp;styled&nbsp;text&nbsp;to&nbsp;the&nbsp;map.&nbsp;I&nbsp;want&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;input&nbsp;the&nbsp;angle&nbsp;of&nbsp;this.&nbsp;I&nbsp;see&nbsp;I&nbsp;can&nbsp;do&nbsp;it&nbsp;with&nbsp;canvas.DrawText(),&nbsp;but&nbsp;this&nbsp;method&nbsp;only&nbsp;takes&nbsp;a&nbsp;screen&nbsp;point&nbsp;and&nbsp;of&nbsp;course&nbsp;will&nbsp;move&nbsp;while&nbsp;the&nbsp;map&nbsp;is&nbsp;panning.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;suggestions&nbsp;on&nbsp;this?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 23, 2014, 1:09am UTC](https://community.thinkgeo.com/t/how-do-i-assign-colors-to-each-shape/3600/10 "2014-01-23T01:09:44Z")

</div>

Hi&nbsp;Scott,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;call&nbsp;ExtentHelper.ToScreenCoordinate&nbsp;function&nbsp;to&nbsp;get&nbsp;sceen&nbsp;coordinate&nbsp;of&nbsp;your&nbsp;upperLeftXInWorld&nbsp;and&nbsp;upperLeftYInWorld.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Then&nbsp;you&nbsp;can&nbsp;create&nbsp;an&nbsp;array&nbsp;like&nbsp;this:&nbsp;  
&nbsp;&nbsp;  
&nbsp;ScreenPointF[]&nbsp;screenPoints&nbsp;=&nbsp;new&nbsp;ScreenPointF[]&nbsp;{&nbsp;new&nbsp;ScreenPointF((float)yourX,&nbsp;(float)yourY)&nbsp;};&nbsp;  
&nbsp;&nbsp;  
&nbsp;And&nbsp;call&nbsp;DrawText&nbsp;function.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
