, Visual C#



35.1. .

private void pictureBox1_Paint(object sender,

PaintEventArgs e)

{

// :

int i, j, k;

// 1- myArrayVC(i, j):

int N_x = 201; int N_y = 2;

// 1- myArrayVC(i, j) float,

// i = 0,1,2,3,...,(N_x - 1);

// j = 0,1,2,3,...,(N_y - 1):

float[,] myArrayVC = new float[N_x, N_y];

//

// D:\\MyDocs\\MyTest3D_Graphics.txt

// myArrayVC(201, 2)

// sr StreamReader:

StreamReader sr =

new StreamReader(

@"D:\\MyDocs\\MyTest3D_Graphics.txt");

// MyTest3D_Graphics.txt

// myArrayVC(201, 2)

// ReadLine:

for (i = 0; i <= N_x - 1; i++)

for (j = 0; j <= N_y - 1; j++)

myArrayVC[i, j] =

Convert.ToSingle(sr.ReadLine());

sr.Close();

// .

// :

float x1, y1, x2, y2;

// myPen 3:

Pen myPen = new Pen(Color.Black, 3);

// N_first_line

// N_last_line :

int N_first_line, N_last_line;

//

// myArrayVC:

N_first_line = Convert.ToInt32(myArrayVC[0, 0]);

N_last_line = Convert.ToInt32(myArrayVC[0, 1]);

// , (1,0; 1,1):

i = -1;

for (k = N_first_line; k <= N_last_line; k++)

{

i = i + 2;

x1 = myArrayVC[i, 0];