forked from ROALOCH/cucei-analizador-imagenes-algoritmia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.cs
76 lines (69 loc) · 2.42 KB
/
MainWindow.cs
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HUNT
{
public partial class MainWindow : Form
{
Functions library = new Functions();
Bitmap shapeD, processed, graph;
Graphics processedG, graphG;
Graph g;
public MainWindow()
{
InitializeComponent();
}
private void buttonAdd_Click(object sender, EventArgs e)
{
OpenFileDialog file = new OpenFileDialog();
file.Filter = "Imagen (*.PNG; *.JPG) | *.PNG; *.JPG";
if(DialogResult.OK == file.ShowDialog())
{
shapeD = new Bitmap(file.FileName);
processed = new Bitmap(file.FileName);
graph = new Bitmap(shapeD.Width, shapeD.Height);
processedG = Graphics.FromImage(processed);
graphG = Graphics.FromImage(graph);
g = new Graph();
pictureBox.Image = processed;
buttonProcess.Enabled = true;
}
}
private void buttonProcess_Click(object sender, EventArgs e)
{
buttonProcess.Enabled = false;
library.processImage(shapeD, processed, processedG, graphG, g);
buttonSave.Enabled = true;
buttonSimulate.Enabled = true;
pictureBox.Refresh();
}
private void buttonSave_Click(object sender, EventArgs e)
{
}
private void buttonSimulate_Click(object sender, EventArgs e)
{
ConfigWindow configWindow = new ConfigWindow();
if (DialogResult.OK == configWindow.ShowDialog())
{
bool radar = configWindow.getRadar();
bool relation = configWindow.getRelation();
bool route = configWindow.getRoute();
bool health = configWindow.getHealth();
int radarSize = configWindow.getRadarSize();
SimulationWindow simulationWindow = new SimulationWindow(radar, relation, route, health, radarSize, g, graph, graphG);
simulationWindow.ShowDialog();
g.clearPP();
}
}
private void buttonExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}