@@ -20,8 +20,7 @@ Public Class Form1
20
20
''' </summary>
21
21
Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load
22
22
Me .TopMost = True
23
- 'Machine = New Machine(New FastRecognition, Nothing, False)
24
- Machine = New Machine( New ClusteringRecognition, Nothing , True )
23
+ Machine = New Machine( Nothing , Nothing , True )
25
24
End Sub
26
25
''' <summary>
27
26
''' 复制屏幕
@@ -35,28 +34,38 @@ Public Class Form1
35
34
End Sub
36
35
''' <summary>
37
36
''' 鼠标绘制
38
- ''' </summary>
37
+ ''' </summary>t
39
38
Private Sub Button2_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
40
- Me .Hide()
41
- Machine.ResetReconition( New FastRecognition)
42
- Machine.ResetPainter( New MousePainter( New Vector2(TabPage1.PointToScreen( New Point( 0 , 0 )).X + 3 , TabPage1.PointToScreen( New Point( 0 , 0 )).Y + 3 )))
43
- AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
44
- Machine.Run()
45
- Me .Show()
39
+ If MessageBox.Show( "Are you sure the window is on microsoft paint application?" + vbCrLf +
40
+ "(Please remember the hot keys,it's useful.)" , "Warning" , MessageBoxButtons.YesNo) = DialogResult.Yes Then
41
+ Me .Hide()
42
+ Machine.ResetReconition( New FastRecognition)
43
+ Machine.ResetPainter( New MousePainter( New Vector2(TabPage1.PointToScreen( New Point( 0 , 0 )).X + 3 , TabPage1.PointToScreen( New Point( 0 , 0 )).Y + 3 )))
44
+ Machine.IsUseOriginal = False
45
+ AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
46
+ Machine.Run()
47
+ Me .Show()
48
+ End If
46
49
End Sub
47
50
''' <summary>
48
51
''' 预览绘制
49
52
''' </summary>
50
53
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
54
+ Static HasShownBox As Boolean = False
55
+ If Not HasShownBox Then
56
+ MessageBox.Show( "The clustering algorithm may take serveral or dozens of seconds, please wait patiently." , "Info" )
57
+ End If
51
58
If Machine.Final IsNot Nothing Then
52
59
TabControl1.SelectedIndex = 2
53
60
Machine.Preview = New Drawing.Bitmap(Machine.Final.Width, Machine.Final.Height)
54
61
PictureBox2.Image = Machine.Preview
62
+ Machine.ResetReconition( New ClusteringRecognition)
55
63
Machine.ResetPainter( New BitmapPainter(Machine.Preview, True ))
64
+ Machine.IsUseOriginal = True
56
65
AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
57
66
Machine.Run()
58
67
Else
59
- MsgBox( "请先复制屏幕" )
68
+ MsgBox( "Please press Screenshot button.( 请先复制屏幕) " )
60
69
End If
61
70
End Sub
62
71
''' <summary>
@@ -90,8 +99,8 @@ Public Class Form1
90
99
''' <summary>
91
100
''' 画布大小改变时
92
101
''' </summary>
93
- Private Sub PictureBox2_SizeChanged (sender As Object , e As EventArgs)
94
- ToolStripStatusLabel3.Text = "Size:" & PictureBox2 .Width & "*" & PictureBox2 .Height & "Pixel"
102
+ Private Sub PictureBox1_SizeChanged (sender As Object , e As EventArgs) Handles PictureBox1.SizeChanged
103
+ ToolStripStatusLabel3.Text = "Size:" & PictureBox1 .Width & "*" & PictureBox1 .Height & "Pixel"
95
104
End Sub
96
105
''' <summary>
97
106
''' 选项卡切换时
0 commit comments