VS2008中使用Tchart画图有关问题

VS2008中使用Tchart画图问题
本帖最后由 blueendyang 于 2013-06-03 10:44:29 编辑
我现在需要画一个SAR成像的contour图,在Tchart中用contour画图不成,网上找到有用colorGrid画的。http://coosign.i.sohu.com/blog/view/177601589.htm
我自己试了下出现了问题,想问问这个问题怎么解决?
代码如下

COleSafeArray XX;  //color grid的横坐标
 COleSafeArray ZZ;  //color grid的纵坐标,与我们常用的Y一样
 COleSafeArray YY; // 表示的是颜色的值,不是Y轴

 DWORD numElements[] = {180001};

 XX.Create(VT_I4, 1, numElements);
 YY.Create(VT_R8, 1, numElements);
 ZZ.Create(VT_I4, 1, numElements);

 long xIndex;
 long zIndex;
 long i=0;
 for (xIndex=0; xIndex<90; xIndex++)
 {
  for (zIndex=0; zIndex<2000; zIndex++)
  {
   double val =zIndex*xIndex;  //二维数组对应的值
   YY.PutElement(&i,&val);
   XX.PutElement(&i,&xIndex);
   ZZ.PutElement(&i,&zIndex);
   i++;
  }
 }
ContourSeries = m_pchart.Series(0);
ContourSeries.GetAsColorGrid().AddArrayXYZ(XX,YY, ZZ);

其中ContourSeries定义的是CColorGridSeris类型的,m_pchart是CTchart类型的。
VS2008中使用Tchart画图有关问题
Tchart 成像 contour图

------解决方案--------------------
没用过TChart  帮顶一下