Files
dfx/dxf/Form1.vb
luca.mustacchio@outlook.it 3c0c8e0e47 Aggiungere i file di progetto.
2026-01-31 12:14:12 +01:00

48 lines
1.7 KiB
VB.net

Imports System.Drawing.Drawing2D
Imports netDxf
Public Class Form1
Dim grafica As GestioneGrafica
Dim dxfTMP As dxf_disegno
Dim puntoMouse As Point
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
dxfTMP = New dxf_disegno(ModuloGestionFile.apriDXF)
dxfTMP.getEntità()
grafica = New GestioneGrafica(PictureBox1)
dxfTMP.disegna(grafica.GetGraphics)
grafica.FinalizzaGrafica()
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
puntoMouse = e.Location
End Sub
Dim sparisce = 0
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
sparisce += 1
If IsNothing(dxfTMP) = False Then
grafica.GetGraphics.Clear(Color.Black)
dxfTMP.disegna(grafica.GetGraphics)
If dxfTMP.inizializzato = True Then
For Each p As GraphicsPath In dxfTMP.path
If p.IsOutlineVisible(puntoMouse, New Pen(Color.White, 10)) Then
grafica.GetGraphics.DrawPath(New Pen(Color.FromArgb(120, 255, 0, 0), 5), p)
Dim i As Integer = dxfTMP.path.IndexOf(p)
Dim s = dxfTMP.DatiEntità(i)
sparisce = 0
Label1.Text = s
End If
Next
End If
If sparisce = 10 Then Label1.Text = ""
grafica.FinalizzaGrafica()
End If
End Sub
End Class