📄 main2.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmmain2
Caption = "Form1"
ClientHeight = 4635
ClientLeft = 60
ClientTop = 450
ClientWidth = 7755
LinkTopic = "Form1"
ScaleHeight = 4635
ScaleWidth = 7755
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog Cmdlg1
Left = 7440
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame2
Caption = "图像处理方法"
Height = 855
Left = 3600
TabIndex = 3
Top = 3600
Width = 4095
Begin VB.CommandButton cmdL
Caption = "亮化"
Height = 375
Left = 3120
TabIndex = 12
Top = 360
Width = 855
End
Begin VB.CommandButton Cmdb
Caption = "单色B"
Height = 375
Left = 2160
TabIndex = 9
Top = 360
Width = 855
End
Begin VB.CommandButton Cmdg
Caption = "单色G"
Height = 375
Left = 1200
TabIndex = 8
Top = 360
Width = 855
End
Begin VB.CommandButton Cmdr
Caption = "黑白R"
Height = 375
Left = 120
TabIndex = 7
Top = 360
Width = 975
End
End
Begin VB.Frame Frame1
Caption = "图像编辑"
Height = 855
Left = 120
TabIndex = 2
Top = 3600
Width = 3375
Begin VB.CommandButton cmdexit
Caption = "结束"
Height = 375
Left = 2280
TabIndex = 6
Top = 360
Width = 975
End
Begin VB.CommandButton cmdsave
Caption = "保存"
Height = 375
Left = 1200
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.CommandButton cmdopen
Caption = "图像输入"
Height = 375
Left = 120
TabIndex = 4
Top = 360
Width = 975
End
End
Begin VB.PictureBox Pic2
Height = 2775
Left = 3960
ScaleHeight = 2715
ScaleMode = 0 'User
ScaleWidth = 3375
TabIndex = 1
Top = 360
Width = 3495
End
Begin VB.PictureBox Pic1
Height = 2775
Left = 240
ScaleHeight = 2715
ScaleWidth = 3315
TabIndex = 0
Top = 360
Width = 3375
Begin VB.Image Image1
Height = 2895
Left = 0
Top = 0
Width = 3375
End
End
Begin VB.Label Label2
Caption = "处理后:"
Height = 255
Left = 4080
TabIndex = 11
Top = 120
Width = 735
End
Begin VB.Label Label1
Caption = "处理前:"
Height = 255
Left = 240
TabIndex = 10
Top = 120
Width = 855
End
End
Attribute VB_Name = "frmmain2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmdb_Click()
Dim i As Integer
Dim j As Integer
Dim c As Long
Dim r As Long
Dim g As Long
Dim b As Long
Dim rr As Integer
Dim gg As Integer
Dim bb As Integer
Dim n As Long
Pic2.Cls
Screen.MousePointer = 11
progressbar1.Min = 0
progressbar1.Max = Pic1.Width
progressbar1.Visible = True
progressbar1.Value = progressbar1.Min
n = 0
For i = 1 To Pic1.Width
For j = 1 To Pic1.Height
c = Pic1.Point(i, j)
r = c And &HFF
g = (c And 65280) \ 256
b = (c And &HFF0000) \ 65536
bb = b
Pic2.PSet (i, j), RGB(bb, bb, bb)
Next j
n = n + 1
progressbar1.Value = n
Next i
progressbar1.visual = False
Screen.MousePointer = 0
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdopen_Click()
On Error GoTo err_handle
Cmdlg1.ShowOpen
Image1.Stretch = True
Image1.Picture = LoadPicture(Cmdlg1.FileName)
err_handle:
End Sub
Private Sub text1_Change()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -