ColorGrid
Posted: Tue Jun 13, 2006 11:54 am
I want to display certain values in a ColorGrid. Therefore, I wrote the following code:
colorGrid1.ClearPalette();
colorGrid1.AddPalette(1.0, Color.Red);
colorGrid1.AddPalette(1.5, Color.Blue);
colorGrid1.AddPalette(2.0, Color.Black);
this.colorGrid1.BeginUpdate();
this.colorGrid1.Clear();
double[] x = {1.0, 1.5, 1.0};
double[] y = {1.0, 1.5, 1.5};
double[] z = {1.0, 1.5, 2.0};
this.colorGrid1.Add(x, y, z);
this.colorGrid1.CheckOrder();
this.colorGrid1.EndUpdate();
As you can see, the z-value
* 1.0 should be displayed red
* 1.5 should be displayed blue
* 2.0 should be displayed black
Unfortunately my code does not work. The program crashes down to a System.IndexOutOfRangeException.
Any ideas?
colorGrid1.ClearPalette();
colorGrid1.AddPalette(1.0, Color.Red);
colorGrid1.AddPalette(1.5, Color.Blue);
colorGrid1.AddPalette(2.0, Color.Black);
this.colorGrid1.BeginUpdate();
this.colorGrid1.Clear();
double[] x = {1.0, 1.5, 1.0};
double[] y = {1.0, 1.5, 1.5};
double[] z = {1.0, 1.5, 2.0};
this.colorGrid1.Add(x, y, z);
this.colorGrid1.CheckOrder();
this.colorGrid1.EndUpdate();
As you can see, the z-value
* 1.0 should be displayed red
* 1.5 should be displayed blue
* 2.0 should be displayed black
Unfortunately my code does not work. The program crashes down to a System.IndexOutOfRangeException.
Any ideas?