📄 board.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Appearance = 0 'Flat
AutoRedraw = -1 'True
BorderStyle = 0 'None
Caption = "作图区"
ClientHeight = 6120
ClientLeft = 2940
ClientTop = 1680
ClientWidth = 6645
FillColor = &H00C0C0C0&
ForeColor = &H00808080&
Icon = "board.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 408
ScaleMode = 3 'Pixel
ScaleWidth = 443
ShowInTaskbar = 0 'False
Begin VB.PictureBox Picture2
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 855
Left = 5040
ScaleHeight = 53
ScaleMode = 3 'Pixel
ScaleWidth = 37
TabIndex = 0
Top = 1320
Visible = 0 'False
Width = 615
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00FFFFFF&
FillColor = &H00FFFFFF&
Height = 4500
Left = 0
ScaleHeight = 296
ScaleMode = 3 'Pixel
ScaleWidth = 436
TabIndex = 1
Top = 0
Width = 6600
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1
Left = 5040
Top = 3240
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Height = 375
Left = 3840
TabIndex = 2
Text = "Text1"
Top = 2640
Visible = 0 'False
Width = 1095
End
Begin VB.PictureBox Picture3
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 975
Left = 5040
ScaleHeight = 61
ScaleMode = 3 'Pixel
ScaleWidth = 37
TabIndex = 4
Top = 240
Visible = 0 'False
Width = 615
End
Begin VB.Shape Shape3
FillStyle = 0 'Solid
Height = 255
Left = 240
Top = 0
Visible = 0 'False
Width = 255
End
Begin VB.Line Line6
Visible = 0 'False
X1 = 0
X2 = 10
Y1 = 0
Y2 = 10
End
Begin VB.Line Line1
Visible = 0 'False
X1 = 0
X2 = 152
Y1 = 32
Y2 = 128
End
Begin VB.Shape Shape1
Height = 135
Left = 4320
Top = 1440
Visible = 0 'False
Width = 135
End
Begin VB.Line Line2
BorderStyle = 3 'Dot
Visible = 0 'False
X1 = 240
X2 = 144
Y1 = 72
Y2 = 72
End
Begin VB.Line Line3
BorderStyle = 3 'Dot
Visible = 0 'False
X1 = 240
X2 = 240
Y1 = 0
Y2 = 72
End
Begin VB.Line Line4
BorderStyle = 3 'Dot
Visible = 0 'False
X1 = 144
X2 = 144
Y1 = 0
Y2 = 72
End
Begin VB.Line Line5
BorderStyle = 3 'Dot
Visible = 0 'False
X1 = 144
X2 = 240
Y1 = 0
Y2 = 0
End
Begin VB.Shape Shape2
BorderStyle = 3 'Dot
Height = 1815
Left = 960
Top = 2160
Visible = 0 'False
Width = 2655
End
End
Begin VB.Label lindex
BackColor = &H80000007&
Caption = "1"
Height = 495
Left = 3720
TabIndex = 3
Top = 5280
Visible = 0 'False
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function CreatePolygonRgn Lib "GDI32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function Polygon Lib "GDI32" (ByVal hDC As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
Private Declare Function RoundRect Lib "GDI32" (ByVal hDC As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal x3 As Long, ByVal y3 As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOW = 5
Dim nX, nY As Long
Public x1, y1, x2, y2
Dim b As Integer
Dim hRgn As Long
Dim cn As Long
Dim XYPOINT(50) As POINTAPI
Private Sub Form_Load()
RRR = 1
cn = 0
End Sub
Private Sub Picture1_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Curcolor = Form2.Picture11.BackColor
Curbkcolor = Form2.Picture10.BackColor
x1 = X
y1 = Y
If Button = 1 Then
Shape2.BorderColor = Curcolor
Shape2.FillColor = Curbkcolor
Else:
Shape2.BorderColor = Curbkcolor
Shape2.FillColor = Curcolor
End If
'喷枪,启动timer
If hubi = 12 Then
Timer1.Enabled = True
nX = X
nY = Y
b = Button
End If
'插入文字的坐标
If Huabi = 10 Then
On Error GoTo a:
Load Form9
Form9.Show
Form1.Picture1.CurrentX = x1
Form1.Picture1.CurrentY = y1
a:
End If
'画笔:在图形框中画点
If Huabi = 1 Then
Picture1.Line (X, Y)-(X, Y)
Picture1.PSet (X, Y), Curbkcolor
End If
'任意选择
'If Huabi = 14 Then
'Picture1.Line (X, Y)-(X, Y)
'Picture1.PSet (X, Y), Curbkcolor
'End If
'对有颜色的操作赋色值
If Huabi = 9 Or Huabi = 7 Or Huabi = 2 Or Huabi = 3 Or Huabi = 13 Or Huabi = 4 Or Huabi = 6 Or Huabi = 8 Or Huabi = 15 Then
Picture1.PSet (X, Y), Curbkcolor
End If
'颜色填充,鼠标左键是前景颜色,鼠标右键是背景颜色
If Huabi = 5 And Button = 1 Or Button = 2 Then
Select Case Button
Case 1
pic_paint Curcolor, X, Y
Case 2
pic_paint Curbkcolor, X, Y
End Select
End If
'区域选择
If Huabi = 6 Then
Selectx1 = X
Selecty1 = Y
Line2.x1 = X
Line2.y1 = Y
Line3.x1 = X
Line3.y1 = Y
Line2.x2 = X
Line2.y2 = Line2.y1
Line3.y2 = Y
Line3.x2 = Line2.x1
Line4.x1 = Line2.x1
Line4.x2 = Line2.x2
Line4.y1 = Y
Line4.y2 = Y
Line5.x1 = X
Line5.x2 = X
Line5.y1 = Line2.y1
Line5.y2 = Y
Picture1.PSet (X, Y), Curbkcolor
End If
'画多边形
If Huabi = 13 And Button = 1 Then
Picture1.FillColor = Curbkcolor
Picture1.ForeColor = Curcolor
XYPOINT(cn).X = X
XYPOINT(cn).Y = Y
If cn > 0 Then Picture1.Line (XYPOINT(cn).X, XYPOINT(cn).Y)-(XYPOINT(cn - 1).X, XYPOINT(cn - 1).Y), Curcolor
cn = cn + 1
If cn > 50 Then End
End If
End Sub
Private Sub Picture1_Mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single)
'取坐标
x2 = X
y2 = Y
If x1 > x2 Then
maxx = x1
minx = x2
Else:
maxx = x2
minx = x1
End If
If y1 > y2 Then
maxy = y1
miny = y2
Else:
maxy = y2
miny = y1
End If
If maxx - minx > maxy - miny Then
r = maxx - minx
Else: r = maxy - miny
End If
'画多边形
If Huabi = 13 And Button = 2 Then
XYPOINT(cn).X = XYPOINT(0).X
XYPOINT(cn).Y = XYPOINT(0).Y
If cn > 1 Then Picture1.Line (XYPOINT(cn).X, XYPOINT(cn).Y)-(XYPOINT(cn - 1).X, XYPOINT(cn - 1).Y), Curcolor
Picture1.AutoRedraw = False
hRgn = Polygon(Me.hDC, XYPOINT(0), cn)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -