1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
void __fastcall TForm1::Button5Click(TObject *Sender)
{
double a;
double b;
double c;
double d;
int j;
StringGrid1->Visible = false;
Image1->Visible = true;
Image1->Left = 0;
Image1->Top = 0;
Image1->Width = ClientWidth * 2;
Image1->Height = ClientHeight * 2;
Image1->Canvas->Pen->Color = clRed;
Image1->Canvas->Pen->Width = 2;
for (j = 2; j < StringGrid1->RowCount - 1; j++)
{
a = StringGrid1->Cells[14][j].ToDouble();
b = StringGrid1->Cells[13][j].ToDouble();
c = StringGrid1->Cells[14][j + 1].ToDouble();
d = StringGrid1->Cells[13][j + 1].ToDouble();
Image1->Canvas->MoveTo(a, b);
Image1->Canvas->LineTo(c,d); // X,Y
}
} |
Partager