I want to draw curve on form1
In order to fit the curve fully across the height and width of form1
I have to know the size of both width and hieght of the form1
But I am diturbed from where should I get the height and width of form1
Because the curve did not appeared on form1 unless I changed the data
The data of curve are
double qad[360]
along x(horizontaly)
vesus
double d[360]
along y (vertically)
double wid,hi,Rax,Ray, maxValue_X, maxValue_Y;
int x1,y1,x2,y2,i;
Pen pen0 = new Pen(Color.Red);
Graphics Mye = base.CreateGraphics();
Graphics Mye = base.CreateGraphics();
Rax = wid / maxValue_X ;
Ray = hi / maxValue_Y ;
for (i = 0; i < 360-1; i++)
{
x1 = (int)(Rax * qad[i]); y1 = (int)(Ray*d[i]);
x2 = (int)(Rax * qad[i + 1]); y2 = (int)(Ray*d[i + 1]);
Mye.DrawLine(pen0, x1, y1, x2, y2);
}
Should I use
this.WindowState = FormWindowState.Maximized;
wid= Form1.ActiveForm.ClientSize.Width-2*fontx;
hi=Form1.ActiveForm.ClientSize.Height-2*fontx;
Or
this.WindowState = FormWindowState.Maximized;
wid = this.ClientSize.Width - 2* fontx;
hi = this.ClientSize.Height - 2* fontx;