/
FormView.cs
280 lines (218 loc) · 6.57 KB
/
FormView.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Management;
//using XShower;
/// XShower2 ;
//using XShower3;
namespace FormDesigner
{
/// <summary>
/// Summary description for FormView.
/// </summary>
///
public class FormView : System.Windows.Forms.Form
{
//private System.Windows.Forms.PictureBox pictureBox1;
public static FormDesigner.PictureView pictureBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public FormView()
{
//
// Required for Windows Form Designer support
//
p=new ArrayList();
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// FormView
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.AutoScroll = true;
this.BackColor = System.Drawing.SystemColors.ControlDark;
this.ClientSize = new System.Drawing.Size(549, 344);
this.ImeMode = System.Windows.Forms.ImeMode.Off;
this.KeyPreview = true;
this.Name = "FormView";
this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormView";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormView_KeyDown);
this.MaximizedBoundsChanged += new System.EventHandler(this.FormView_MaximizedBoundsChanged);
this.Closing += new System.ComponentModel.CancelEventHandler(this.FormView_Closing);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FormView_KeyPress);
this.Load += new System.EventHandler(this.FormView_Load);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.FormView_KeyUp);
this.Closed += new System.EventHandler(this.FormView_Closed);
this.Activated += new System.EventHandler(this.FormView_Activated);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.FormView_Paint);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new FormView());
}
private void button2_Click(object sender, System.EventArgs e)
{
}
ArrayList p;
private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
}
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void FormView_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
base.OnPaintBackground (pevent);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
}
//xmagic3.xmagic3classClass xim;
private void FormView_Load(object sender, System.EventArgs e)
{
//
// pictureBox1
//
pictureBox1 =new PictureView();
Controls.Add(pictureBox1);
pictureBox1.ControlPoly = true;
pictureBox1.Location = new System.Drawing.Point(8, 8);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(672, 448);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
pictureBox1.SourceFileName = null;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
PictureView.controlStepMouse=false;
PictureView.selectedObj=0;
//pictureBox1.SourceFileName="mainpic.jpg";
//pictureBox1.Image.Dispose();
Bitmap bmpNew= new Bitmap(825,1180);;
bmpNew.SetResolution(100,100);
Graphics.FromImage(bmpNew).FillRectangle(new SolidBrush(Color.White ),new Rectangle(0,0,825,1180));
pictureBox1.Image=bmpNew;
PictureView.BMP=bmpNew;
PictureView.This.SetBitmap();
Graphics g=Graphics.FromImage(pictureBox1.Image);
//pictureBox1.=true;
}
private void pictureBox1_VisibleChanged(object sender, System.EventArgs e)
{
}
private void FormView_Activated(object sender, System.EventArgs e)
{
}
private void FormView_MaximizedBoundsChanged(object sender, System.EventArgs e)
{
int x=1;
}
protected override void WndProc(ref Message m)
{
base.WndProc (ref m);
}
private void button3_Click(object sender, System.EventArgs e)
{
PictureView.selectedObj=6;
PictureView.controlStepMouse=false;
}
private void FormView_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
try
{
if(e.Shift)PictureView.SetShift();
if(((char)e.KeyValue=='X')&&(e.Control==true))
{
//CUT
}
else
{
if(((char)e.KeyValue=='C')&&(e.Control==true))
{
}
}
}
catch(Exception ex)
{
MessageBox.Show("d");
}
}
private void FormView_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
}
private void FormView_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
PictureView.CancelShift ();
}
private void button2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
}
private void pictureBox1_MouseDown_1(object sender, System.Windows.Forms.MouseEventArgs e)
{
}
private void button4_Click(object sender, System.EventArgs e)
{
}
private void trackBar1_Scroll(object sender, System.EventArgs e)
{
}
private void trackBar2_Scroll(object sender, System.EventArgs e)
{
}
private void pictureBox1_Click_1(object sender, System.EventArgs e)
{
}
private void FormView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel=true;
Hide();
}
private void FormView_Closed(object sender, System.EventArgs e)
{
}
}
}