[Programowanie] W jaki sposób połączyć układ współrzędnych z tabelą w pliku txt(7 rzędów i 2 kolumny) w języku C#. Mam stworzony plik oraz narysowany układ jednak nie mam pojęcia jak nałożyć punkty z pliku na układ współrzędnych. Pozdrawiam i liczę na szybką odpowiedź!
0
0
Aktualnei kod wygląda następująco
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication65
{
public partial class Form1 : Form
{
int scale = 15;
public Form1()
{
InitializeComponent();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(Pens.BlueViolet, panel1.Width /2, 0, panel1.Width /2, panel1.Height);
e.Graphics.DrawLine(Pens.BlueViolet, 0, panel1.Height /2, panel1.Width, panel1.Height /2);
Point absZero = new Point(panel1.Width/2, panel1.Height/2);
int i = absZero.X;
while(i<panel1.Width)
{
i +=scale;
e.Graphics.DrawLine(Pens.BlueViolet, i, absZero.Y - 4,i, absZero.Y +4);
}
e.Graphics.DrawLine(Pens.BlueViolet, absZero.X, 0, absZero.X, panel1.Height);
e.Graphics.DrawLine(Pens.BlueViolet, 0, absZero.Y, panel1.Width, absZero.Y);
while(i<panel1.Width)
{
i+=scale;
e.Graphics.DrawLine(Pens.BlueViolet, i, absZero.Y - 4, i, absZero.Y + 4);
}
i=absZero.X;
while(i>0)
{
i-=scale;
e.Graphics.DrawLine(Pens.BlueViolet, i, absZero.Y - 4, i, absZero.Y +4);
}
i=absZero.Y;
while(i<panel1.Height)
{
i+=scale;
e.Graphics.DrawLine(Pens.BlueViolet, absZero.X - 4, i, absZero.X + 4, i);
}
i=absZero.Y;
while(i>0)
{
i -=scale;
e.Graphics.DrawLine(Pens.BlueViolet, absZero.X -4, i, absZero.X +4, i);
}
int X=0;
int Y=0;
int count = 10;
for(int k= -10; k <= count; k++)
{
X=k;
Y=2*X;
e.Graphics.FillEllipse(Brushes.DarkGreen,(absZero.X + (X*scale)) -2,
(absZero.Y - (Y*scale)) - 2,4,4);
}
}
}
}
Przepraszam za podwójny post
0
Pomoc pilnie potrzebna
0
Podaj przykładową treść tego pliku.