📄 form0504.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "显示图片并保存文件"
ClientHeight = 3630
ClientLeft = 60
ClientTop = 345
ClientWidth = 5730
LinkTopic = "Form1"
ScaleHeight = 3630
ScaleWidth = 5730
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 120
Top = 3000
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 4320
TabIndex = 4
Top = 3000
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "另存文件"
Height = 495
Left = 2520
TabIndex = 3
Top = 3000
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "显示图片"
Height = 495
Left = 720
TabIndex = 2
Top = 3000
Width = 1215
End
Begin VB.Frame Frame1
Height = 2535
Left = 480
TabIndex = 0
Top = 240
Width = 4935
Begin VB.PictureBox Picture1
Height = 2175
Left = 120
ScaleHeight = 2115
ScaleWidth = 4635
TabIndex = 1
Top = 240
Width = 4695
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'单击显示图片按钮
With CommonDialog1
.InitDir = "C:\"
.Filter = "BMP文件(*.bmp)|*.bmp|GIF文件(*.gif)|*.gif|JPG文件(*.jpg)|*.jpg"
.Action = 1
Frame1.Caption = .FileName ' 显示文件名
'装载图片框的图形文件
Picture1.Picture = LoadPicture(.FileName)
End With
End Sub
Private Sub Command2_Click()
'单击另存文件按钮
With CommonDialog1
.InitDir = "C:\"
.Filter = "BMP文件(*.bmp)|*.bmp|GIF文件(*.gif)|*.gif|JPG文件(*.jpg)|*.jpg"
.DefaultExt = "jpg"
.Action = 2
SavePicture Picture1.Picture, .FileName
End With
End Sub
Private Sub Command3_Click()
'单击退出按钮
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -