📄 frmdispphoto.frm
字号:
VERSION 5.00
Begin VB.Form FRMDISPPHOTO
BorderStyle = 3 'Fixed Dialog
Caption = "当前档号的图像不存在!"
ClientHeight = 6825
ClientLeft = 45
ClientTop = 330
ClientWidth = 7815
Icon = "FRMDISPPHOTO.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6825
ScaleWidth = 7815
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox PICBOX1
Height = 5655
Left = 30
ScaleHeight = 5595
ScaleWidth = 7665
TabIndex = 8
Top = 30
Visible = 0 'False
Width = 7725
Begin VB.VScrollBar VS1
Height = 5600
LargeChange = 250
Left = 7410
TabIndex = 6
Top = 0
Width = 255
End
Begin VB.HScrollBar HS1
Height = 255
LargeChange = 250
Left = 0
TabIndex = 5
Top = 5340
Width = 7425
End
Begin VB.Image Image2
Height = 5085
Left = 30
Top = 0
Width = 5175
End
End
Begin VB.Frame Frame1
Height = 1035
Left = 30
TabIndex = 7
Top = 5730
Width = 7725
Begin VB.CommandButton Command4
Caption = "打印"
Height = 435
Left = 6510
TabIndex = 4
Top = 360
Visible = 0 'False
Width = 1275
End
Begin VB.CommandButton Command3
Caption = "放大至满屏"
Height = 435
Left = 5040
TabIndex = 2
Top = 360
Visible = 0 'False
Width = 1275
End
Begin VB.CheckBox Check1
Caption = "实际大小"
Height = 255
Left = 240
TabIndex = 3
Top = 450
Width = 1305
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 435
Left = 3510
TabIndex = 1
Top = 360
Width = 1275
End
Begin VB.CommandButton Command1
Caption = "查询光盘信息"
Height = 435
Left = 2040
TabIndex = 0
Top = 360
Width = 1275
End
End
Begin VB.Image Image1
Height = 5655
Left = 30
Stretch = -1 'True
Top = 30
Width = 7725
End
End
Attribute VB_Name = "FRMDISPPHOTO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim M, N As Double
Private Sub Check1_Click()
If Check1.Value = 1 Then
Image1.Visible = False
PICBOX1.Visible = True
Image2.Stretch = False
HS1.Max = Image2.Width
VS1.Max = Image2.Height
HS1.LargeChange = (PICBOX1.Width / Image2.Width) * PICBOX1.Width
VS1.LargeChange = (PICBOX1.Height / Image2.Height) * PICBOX1.Height
VS1.Left = PICBOX1.Width - VS1.Width - 60
HS1.Top = PICBOX1.Height - HS1.Height - 60
VS1.Height = PICBOX1.Height - 55
HS1.Width = PICBOX1.Width - 300
Command3.Visible = True
Command3.Left = Command2.Left + Command2.Width + 300
'VS1.Value = 0
'HS1.Value = 0
Image2.Left = 0
Image2.Top = 0
Else
Command3.Visible = False
Command4.Visible = False
Image1.Visible = True
PICBOX1.Visible = False
End If
End Sub
Private Sub Command1_Click()
Dim CDSTR As String
On Error GoTo ERR
FINDCD
CDSTR = Trim(Left(CDROM, 2))
Dim TEMPCD As String
FRMDISPPHOTO.Caption = "查询到位于光盘上的信息"
TEMPCD = CDSTR + "\PICTURE\" & idphoto & ".BMP"
Image1.Stretch = True
Image1.BorderStyle = 1
Image1.Picture = LoadPicture(TEMPCD)
Exit Sub
ERR:
Image1.Picture = LoadPicture("")
Check1.Enabled = False
MsgBox ERR.Description, , "出错提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Command3.Caption = "放大至满屏" Then
Check1.Visible = False
FRMDISPPHOTO.Width = FRMDISPPHOTO.Width * M
FRMDISPPHOTO.Left = 0
FRMDISPPHOTO.Height = FRMDISPPHOTO.Width * N
FRMDISPPHOTO.Top = 0
Command3.Caption = "缩小"
PICBOX1.Width = PICBOX1.Width * M
PICBOX1.Height = PICBOX1.Height * N
Frame1.Width = Frame1.Width * M
Frame1.Top = Screen.Height - Frame1.Height - 500
VS1.Left = PICBOX1.Width - VS1.Width - 60
HS1.Top = PICBOX1.Height - HS1.Height - 60
VS1.Height = PICBOX1.Height - 55
HS1.Width = PICBOX1.Width - 300
Command4.Visible = True
Command4.Left = Command3.Left + Command3.Width + 300
Image2.Left = 0
Image2.Top = 0
Else
Check1.Visible = True
Check1.Value = 0
Command3.Caption = "放大至满屏"
Command3.Visible = False
Command4.Visible = False
FRMDISPPHOTO.Width = FRMDISPPHOTO.Width / M
FRMDISPPHOTO.Height = FRMDISPPHOTO.Height / N
PICBOX1.Height = PICBOX1.Height / N
PICBOX1.Width = PICBOX1.Width / M
VS1.Left = PICBOX1.Width - VS1.Width - 60
HS1.Top = PICBOX1.Height - HS1.Height - 60
Frame1.Width = Frame1.Width / M
Frame1.Top = FRMDISPPHOTO.Height - Frame1.Height - 500
FRMDISPPHOTO.Left = (Screen.Width - FRMDISPPHOTO.Width) / 2
FRMDISPPHOTO.Top = (Screen.Height - FRMDISPPHOTO.Height) / 2
End If
End Sub
Private Sub Command4_Click()
On Error GoTo ERR
Dim TEMPPIC As String
TEMPPIC = App.Path + "\PICTURE\" + idphoto + ".BMP"
X = Shell("PBRUSH " + TEMPPIC, vbMaximizedFocus)
Exit Sub
ERR:
MsgBox ERR.Description, vbInformation + vbOKOnly, "出错原因提示"
End Sub
Private Sub Form_Activate()
On Error GoTo ERR
Image1.BorderStyle = 1
Image1.Picture = LoadPicture(App.Path + "\picture\" + idphoto + ".bmp")
Image2.Picture = LoadPicture(App.Path + "\picture\" + idphoto + ".bmp")
Image2.Left = 0
Image2.Top = 0
M = Screen.Width / 7905
N = Screen.Height / 7200
Exit Sub
ERR:
MsgBox ERR.Description
End Sub
Private Sub Form_Load()
PICBOX1.Visible = False
Check1.Value = 0
FRMDISPPHOTO.Width = Image1.Width + 200
Image1.Left = 60
Image1.Top = 50
Frame1.Width = Image1.Width
Frame1.Left = 60
Command1.Left = Image1.Width / 2 - Command1.Width - 150
Command2.Left = Command1.Left + Command1.Width + 300
End Sub
Private Sub HS1_Change()
Image2.Left = -(Image2.Width - PICBOX1.Width) * (HS1.Value / HS1.Max)
End Sub
Private Sub HS1_Scroll()
Image2.Left = -(Image2.Width - PICBOX1.Width) * (HS1.Value / HS1.Max)
End Sub
Private Sub VS1_Change()
Image2.Top = -(Image2.Height - PICBOX1.Height) * (VS1.Value / VS1.Max)
End Sub
Private Sub VS1_Scroll()
Image2.Top = -(Image2.Height - PICBOX1.Height) * (VS1.Value / VS1.Max)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -