"map1.Shapes[index].Pen.Color = customclr" does no
Posted: Thu Mar 16, 2006 9:06 am
I am using a map series.
And adding various shapes in the map series using polygon class. See the below code:
I wish to draw each shape's border with different pen color and hence I use the code:
map1.Shapes[index].Pen.Color = clr;
But this does not seem to do anything.
Instead if i use:
map1.Pen.Color it works, but that does not serve my purpose since all the shapes added will have the same color.
How to get around this problem?
Thanks
And adding various shapes in the map series using polygon class. See the below code:
Code: Select all
private void PlotCurve(ArrayList coordinates, Color clr)
{
Polygon pgon = null;
int count = coordinates.Count;
for (int i = 0; i < count; )
{
pgon = new Polygon (map1.Shapes, tChart1.Chart);
double[] values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
++i;
if(i<count)
{
values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
}
++i;
if(i<count)
{
values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
int index = map1.Shapes.Add(pgon);
map1.ColorEach = true;
map1.Shapes[index].ParentBrush=false;
map1.Shapes[index].Color = clr;
map1.Shapes[index].Pen.Color = clr;
--i;
}
}
map1.Shapes[index].Pen.Color = clr;
But this does not seem to do anything.
Instead if i use:
map1.Pen.Color it works, but that does not serve my purpose since all the shapes added will have the same color.
How to get around this problem?
Thanks