⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawplat.frm

📁 内似于WINDOWS的画比工具的VB程序
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   6
         Left            =   0
         TabIndex        =   7
         ToolTipText     =   "喷枪"
         Top             =   1475
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   5
         Left            =   360
         TabIndex        =   6
         ToolTipText     =   "刷子"
         Top             =   1095
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   4
         Left            =   0
         TabIndex        =   5
         ToolTipText     =   "画笔"
         Top             =   1095
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   3
         Left            =   360
         TabIndex        =   4
         ToolTipText     =   "放大镜"
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   2
         Left            =   0
         TabIndex        =   3
         ToolTipText     =   "取色"
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   1
         Left            =   360
         TabIndex        =   2
         ToolTipText     =   "颜色填充"
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Height          =   375
         Index           =   0
         Left            =   0
         TabIndex        =   1
         ToolTipText     =   "橡皮擦"
         Top             =   360
         Width           =   375
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1140
      Left            =   840
      TabIndex        =   17
      Top             =   3120
      Visible         =   0   'False
      Width           =   615
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   135
         Index           =   5
         Left            =   240
         TabIndex        =   20
         Top             =   240
         Width           =   135
      End
      Begin VB.Shape Shape6 
         BackColor       =   &H00C0FFFF&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00C0FFFF&
         Height          =   105
         Left            =   240
         Shape           =   3  'Circle
         Top             =   240
         Width           =   105
      End
      Begin VB.Shape Shape5 
         BackColor       =   &H00C0FFFF&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00C0FFFF&
         Height          =   195
         Left            =   190
         Shape           =   3  'Circle
         Top             =   440
         Width           =   195
      End
      Begin VB.Shape Shape4 
         BackColor       =   &H00C0FFFF&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00C0FFFF&
         Height          =   300
         Left            =   140
         Shape           =   3  'Circle
         Top             =   720
         Width           =   300
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   18
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   375
         Index           =   4
         Left            =   120
         TabIndex        =   19
         Top             =   720
         Width           =   375
      End
   End
   Begin VB.Frame Frame2 
      Height          =   1050
      Left            =   0
      TabIndex        =   13
      Top             =   3120
      Visible         =   0   'False
      Width           =   615
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   135
         Index           =   2
         Left            =   120
         TabIndex        =   16
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   135
         Index           =   1
         Left            =   120
         TabIndex        =   15
         Top             =   480
         Width           =   375
      End
      Begin VB.Shape Shape3 
         BackColor       =   &H00FF8080&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00FF8080&
         Height          =   135
         Left            =   120
         Top             =   720
         Width           =   375
      End
      Begin VB.Shape Shape2 
         BackColor       =   &H00FF8080&
         BackStyle       =   1  'Opaque
         Height          =   135
         Left            =   120
         Top             =   480
         Width           =   375
      End
      Begin VB.Shape Shape1 
         Height          =   135
         Left            =   120
         Top             =   240
         Width           =   375
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Height          =   135
         Index           =   0
         Left            =   120
         TabIndex        =   14
         Top             =   240
         Width           =   375
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Private Declare Function StretchBlt Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Dim i, cn As Integer

Private Sub Form_Load()
Frame1.Left = 6
Frame2.Left = 6
Frame3.Left = 6
Frame4.Left = 6
Frame5.Left = 6
Frame6.Left = 6
Frame1.Top = 208
Frame2.Top = 208
Frame3.Top = 208
Frame4.Top = 208
Frame5.Top = 208
Frame6.Top = 208
Form3.Width = 825
Frame4.Left = 6
For i = 0 To 4
Label1(i).BorderStyle = 0
Next i
For i = 0 To 15
Label4(i).BorderStyle = 0
Next i
For i = 0 To 3
Label6(i).BorderStyle = 0
Next i
For i = 1 To 12
Label2(i).BorderStyle = 0
Next i


End Sub

Private Sub Label1_Click(Index As Integer)
For i = 0 To 4
Label1(i).BorderStyle = 0
Next i
Label1(Index).BorderStyle = 1
Form1.Line1.BorderWidth = Index + 1
Form1.Picture1.DrawWidth = Form1.Line1.BorderWidth
End Sub

Private Sub Label2_Click(Index As Integer)
For i = 1 To 12
Label2(i).BorderStyle = 0
Next i
Label2(Index).BorderStyle = 1
Form1.lindex.Caption = Index
End Sub

Private Sub label4_Click(Index As Integer)
'初值设定
Form1.Picture2.Picture = Form1.Picture1.Picture
Form2.Label1.Caption = Label4(Index).ToolTipText
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
'画图区的选择(控件组)
For i = 0 To 15
Label4(i).BorderStyle = 0
Next i
Label4(Index).BorderStyle = 1
Select Case Index
 '画笔
 Case 4
  Huabi = 1
  Form1.Shape1.Visible = False
  lhide
'吸管
 Case 2
Huabi = 8
Form1.Shape1.Visible = False
lhide
 '橡皮
 Case 0
 Frame4.Visible = True
 Form1.Shape1.Visible = True
Huabi = 7
lhide
 '区域选取
 Case 10
Selected = 0
Selectx1 = 1
Selecty1 = 1
Selectx2 = 1
Selecty2 = 1
Form1.Line2.x1 = 0
Form1.Line2.y1 = 0
Form1.Line2.x2 = 0
Form1.Line2.y2 = 0
Form1.Line3.x1 = 0
Form1.Line3.y1 = 0
Form1.Line3.x2 = 0
Form1.Line3.y2 = 0
Form1.Line4.x1 = 0
Form1.Line4.y1 = 0
Form1.Line4.x2 = 0
Form1.Line4.y2 = 0
Form1.Line5.x1 = 0
Form1.Line5.y1 = 0
Form1.Line5.x2 = 0
Form1.Line5.y2 = 0
Huabi = 6
Form1.Shape1.Visible = False
lshow
 '颜色填充
 Case 1
Huabi = 5
Form1.Shape1.Visible = False
lhide
 '画矩形
 Case 9
Form1.Shape2.Shape = 0
Frame2.Visible = True
Huabi = 4
Form1.Shape1.Visible = False
lhide
 '画线
 Case 8
Frame5.Visible = True
Huabi = 2
Form1.Shape1.Visible = False
lhide
 '画圆
 Case 11
Form1.Shape2.Shape = 2
Frame2.Visible = True
Huabi = 3
Form1.Shape1.Visible = False
lhide
'刷子
Case 5
 Frame6.Visible = True
 Huabi = 9
lhide
'放大镜
Case 3
Form1.Picture3.AutoSize = True
SavePicture Form1.Picture1.Image, "backup.bmp"
Frame3.Visible = True
Form1.Picture2.Picture = LoadPicture("backup.bmp")
Form1.Picture2.AutoSize = False
If Form1.Picture2.Width > Form1.Picture2.Height Then
Form1.Picture2.Height = Form1.Picture2.Width
Else: Form1.Picture2.Width = Form1.Picture2.Height
End If
Form1.Picture2.AutoSize = True
Form1.Picture3.Picture = LoadPicture("backup.bmp")
Form1.Picture3.AutoSize = False

'喷枪
Case 6
Frame1.Visible = True
Huabi = 12
lhide
'插入文字
Case 7
Huabi = 10
lhide

'任意形状选取
Case 12
Huabi = 16
lhide
'画多边形
Case 13
Frame2.Visible = True
Huabi = 13
Form1.Shape1.Visible = False
cn = 0
lhide
'画曲线
Case 14
Frame5.Visible = True
Huabi = 2
Form1.Shape1.Visible = False
lhide
'画圆角矩形
Case 15
Form1.Shape2.Shape = 4
Frame2.Visible = True
Huabi = 15
Form1.Shape1.Visible = False
lhide
End Select
End Sub
'画图分项的选择
Private Sub Label5_Click(Index As Integer)
Form1.lindex.Caption = Index
Form1.Shape2.BorderColor = Form2.Picture11.BackColor
Form1.Shape2.BackColor = Form2.Picture10.BackColor
Select Case Index
'画矩形,圆形的选择
Case 0
Form1.Picture1.FillStyle = 1
Form2.Label1.Caption = "画空心形"
Form1.Shape2.FillStyle = 1
Case 1
Form2.Label1.Caption = "画实心形"
Form1.Picture1.FillStyle = 0
Form1.Shape2.FillStyle = 0
Case 2
Form2.Label1.Caption = "画无边实心形"
Form1.Picture1.FillStyle = 0
Form1.Shape2.FillStyle = 0
'喷枪的选择
'半径(小)
Case 5
If Huabi = 9 Then
Form1.Shape1.Shape = 3
Form1.Shape1.FillColor = Form2.Picture11.BackColor
Form1.Shape1.FillStyle = 0
Form1.Shape1.Width = Shape6.Width / 15
Form1.Shape1.Height = Shape6.Height / 15
End If
If Huabi = 12 Then RRR = 0.5
'半径(中)
Case 3
If Huabi = 9 Then
Form1.Shape1.Shape = 3
Form1.Shape1.FillColor = Form2.Picture11.BackColor
Form1.Shape1.FillStyle = 0
Form1.Shape1.Width = Shape5.Width / 15
Form1.Shape1.Height = Shape5.Height / 15
End If
If Huabi = 12 Then RRR = 1
'半径(大)
Case 4
If Huabi = 9 Then
Form1.Shape1.Shape = 3
Form1.Shape1.FillColor = Form2.Picture11.BackColor
Form1.Shape1.FillStyle = 0
Form1.Shape1.Width = Shape4.Width / 15
Form1.Shape1.Height = Shape4.Height / 15
End If
If Huabi = 12 Then RRR = 2
'放大镜的选择
'放大2倍
Case 6
Form1.Picture3.Cls
Form1.Picture3.Width = Form1.Picture3.Width * 2
Form1.Picture3.Height = Form1.Picture3.Height * 2
StretchBlt Form1.Picture3.hDC, 0, 0, Form1.Picture3.Width, Form1.Picture3.Height, Form1.Picture3.hDC, 0, 0, Form1.Picture2.Width, Form1.Picture2.Height, vbSrcCopy
Form1.Picture3.Refresh
SavePicture Form1.Picture3.Image, "backup.bmp"
Form1.Picture1.Picture = LoadPicture("backup.bmp")
'放大4倍
Case 7
Form1.Picture3.Cls
Form1.Picture3.Width = Form1.Picture3.Width * 4
Form1.Picture3.Height = Form1.Picture3.Height * 4
StretchBlt Form1.Picture3.hDC, 0, 0, Form1.Picture3.Width, Form1.Picture3.Height, Form1.Picture3.hDC, 0, 0, Form1.Picture2.Width, Form1.Picture2.Height, vbSrcCopy
Form1.Picture3.Refresh
SavePicture Form1.Picture3.Image, "backup.bmp"
Form1.Picture1.Picture = LoadPicture("backup.bmp")

'放大6倍
Case 8
Form1.Picture3.Cls
Form1.Picture3.Width = Form1.Picture3.Width * 6
Form1.Picture3.Height = Form1.Picture3.Height * 6
StretchBlt Form1.Picture3.hDC, 0, 0, Form1.Picture3.Width, Form1.Picture3.Height, Form1.Picture3.hDC, 0, 0, Form1.Picture2.Width, Form1.Picture2.Height, vbSrcCopy
Form1.Picture3.Refresh
SavePicture Form1.Picture3.Image, "backup.bmp"
Form1.Picture1.Picture = LoadPicture("backup.bmp")
End Select
End Sub

Private Sub Label6_Click(Index As Integer)
For i = 0 To 3
Label6(i).BorderStyle = 0
Next i
Label6(Index).BorderStyle = 1
Form1.Shape1.Height = Label6(Index).Height / 17
Form1.Shape1.Width = Label6(Index).Width / 17

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -