看看这个绘图程序有什么问题,第五次循环的时候,就报System.OverflowException在 system.drawing.dll 谢谢大家
定义:
private: int size_x;
private: System::Drawing::Graphics* b;
private: System::Drawing::Pen* a;
初始化
int i;
double PI;
PI=atan((double)1)*4;
size_x=1024;
a=new System::Drawing::Pen(Color::Red,1);
initW(size_x);
绘图
int x1,x2,y1,y2,i,x;
Double dj;
x1=0;
y1=0;
x=record(wavedata);
for (i=0;i<1000;i++)
{
xx[i].real=wavedata[i];
}
fft(xx);
for(i=0;i<size_x;i++)
{
dj=sqrt(pow(xx[i].real,2)+pow(xx[i].img,2));
y2=int(p1->Height-(double(dj)/64)*p1->Height);
x2=int((double(i)/size_x)*p1->Width);
b= p1->CreateGraphics();
b->DrawLine(a,x1,y1,x2,y2);
b->Dispose();
x1=x2;
y1=y2;
}