"map1.Shapes[index].Pen.Color = customclr" does no

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lakshmi
Newbie
Newbie
Posts: 40
Joined: Fri Oct 07, 2005 4:00 am
Location: India
Contact:

"map1.Shapes[index].Pen.Color = customclr" does no

Post by Lakshmi » 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:

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;
                }
            }            
 
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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 20, 2006 3:09 pm

Hi Lakshmi,

I'm afraid this is not currently possible. I've added your request to our wish-list to be considered for inclusion in future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Mar 22, 2006 8:48 am

Hi Lakshmi,

Sorry but a colleague told me that it could be achieved doing something like:

Code: Select all

			for(int i=0;i<map1.Shapes.Count;++i)
			{
				map1.Shapes[i].ParentPen=false;
				map1.Shapes[i].ParentBrush=false;
				map1.Shapes[i].Pen.Color=Color.FromArgb(50+i*4,50+i*4,50+i*4);
				map1.Shapes[i].Brush.Color=Color.FromArgb(50+i*4,50+i*4,50+i*4);
				map1.Shapes[i].Pen.Width=2;
			}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply