Torna al Thread

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; namespace _VirtualCnc { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } private void Simula_Click(object sender, EventArgs e) { Elabora_.Enabled = true; Elabora_.Interval = 10; pBelaboarazione.Value = 100; this.box.Image = null; Bitmap bmp = new Bitmap(this.box.Width / 2, this.box.Height / 2); Graphics g = Graphics.FromImage(bmp); Pen redPen = new Pen(Color.Red, 1 / g.DpiX); redPen.Width = 2; g.PageUnit = GraphicsUnit.Millimeter; List<PointF> pt = new List<PointF>(); string line = "" + tbCode.Text + ""; string[] coordinate = line.Split(';'); foreach (string s in coordinate) { int x = Convert.ToInt32(coordinate[0]); int y = Convert.ToInt32(coordinate[1]); PointF p = new PointF(x, y); pt.Add(p); Pen pen = new Pen(Color.Black, 3); g.DrawLine(pen, 0, 0, p.X, p.Y); pBelaboarazione.Value = 100; } //int x = Convert.ToInt32(coordinate[0]); //int y = Convert.ToInt32(coordinate[1]); this.box.Image = bmp; } // Pulsante simula private void box_Paint(object sender, PaintEventArgs e) { } private void ApriProgramma_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = "File di Testo (*.txt)|*.txt|File Cnc(*.cnc)|*.cnc"; if (open.ShowDialog() == DialogResult.OK) { tbCode.Text = File.ReadAllText(open.FileName) + ""; // Aggiunta codice alla listbox sbp_file.Text = "File Caricato: " + open.FileName + ""; // barra di stato per recuperare il file. } }// Apri programma private void Elabora__Tick(object sender, EventArgs e) { } private void MenuFileEsci_Click(object sender, EventArgs e) { this.Close(); } // Pulsante Esci Menu private void FermaElaborazione_Click(object sender, EventArgs e) { Elabora_.Enabled = false; pBelaboarazione.Value = 0; box.Refresh(); } private void MenuGuida_Click(object sender, EventArgs e) { AboutBox1 about = new AboutBox1(); about.Show(); } // Pulsante che ferma la simulazione } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5