Skip to content

Commit

Permalink
添加新的英文文本提示框
Browse files Browse the repository at this point in the history
提示用户等待和避免误操作
  • Loading branch information
experdot committed Jan 28, 2018
1 parent 8881bba commit 08c107e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
46 changes: 46 additions & 0 deletions AutomaticDrawing/Form/Form1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 21 additions & 12 deletions AutomaticDrawing/Form/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Public Class Form1
''' </summary>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TopMost = True
'Machine = New Machine(New FastRecognition, Nothing, False)
Machine = New Machine(New ClusteringRecognition, Nothing, True)
Machine = New Machine(Nothing, Nothing, True)
End Sub
''' <summary>
''' 复制屏幕
Expand All @@ -35,28 +34,38 @@ Public Class Form1
End Sub
''' <summary>
''' 鼠标绘制
''' </summary>
''' </summary>t
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Hide()
Machine.ResetReconition(New FastRecognition)
Machine.ResetPainter(New MousePainter(New Vector2(TabPage1.PointToScreen(New Point(0, 0)).X + 3, TabPage1.PointToScreen(New Point(0, 0)).Y + 3)))
AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
Machine.Run()
Me.Show()
If MessageBox.Show("Are you sure the window is on microsoft paint application?" + vbCrLf +
"(Please remember the hot keys,it's useful.)", "Warning", MessageBoxButtons.YesNo) = DialogResult.Yes Then
Me.Hide()
Machine.ResetReconition(New FastRecognition)
Machine.ResetPainter(New MousePainter(New Vector2(TabPage1.PointToScreen(New Point(0, 0)).X + 3, TabPage1.PointToScreen(New Point(0, 0)).Y + 3)))
Machine.IsUseOriginal = False
AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
Machine.Run()
Me.Show()
End If
End Sub
''' <summary>
''' 预览绘制
''' </summary>
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
Static HasShownBox As Boolean = False
If Not HasShownBox Then
MessageBox.Show("The clustering algorithm may take serveral or dozens of seconds, please wait patiently.", "Info")
End If
If Machine.Final IsNot Nothing Then
TabControl1.SelectedIndex = 2
Machine.Preview = New Drawing.Bitmap(Machine.Final.Width, Machine.Final.Height)
PictureBox2.Image = Machine.Preview
Machine.ResetReconition(New ClusteringRecognition)
Machine.ResetPainter(New BitmapPainter(Machine.Preview, True))
Machine.IsUseOriginal = True
AddHandler Machine.Painter.UpdatePaint, AddressOf RefreshPicturebox2
Machine.Run()
Else
MsgBox("请先复制屏幕")
MsgBox("Please press Screenshot button.(请先复制屏幕)")
End If
End Sub
''' <summary>
Expand Down Expand Up @@ -90,8 +99,8 @@ Public Class Form1
''' <summary>
''' 画布大小改变时
''' </summary>
Private Sub PictureBox2_SizeChanged(sender As Object, e As EventArgs)
ToolStripStatusLabel3.Text = "Size:" & PictureBox2.Width & "*" & PictureBox2.Height & "Pixel"
Private Sub PictureBox1_SizeChanged(sender As Object, e As EventArgs) Handles PictureBox1.SizeChanged
ToolStripStatusLabel3.Text = "Size:" & PictureBox1.Width & "*" & PictureBox1.Height & "Pixel"
End Sub
''' <summary>
''' 选项卡切换时
Expand Down

0 comments on commit 08c107e

Please sign in to comment.