📄 图像放缩.frm
字号:
VERSION 5.00
Begin VB.Form frmzoom
Caption = "图像放缩"
ClientHeight = 4020
ClientLeft = 60
ClientTop = 450
ClientWidth = 5655
LinkTopic = "Form1"
ScaleHeight = 4020
ScaleWidth = 5655
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Exit"
Height = 375
Index = 2
Left = 3360
TabIndex = 2
Top = 3480
Width = 975
End
Begin VB.CommandButton Command1
Caption = "缩小"
Height = 375
Index = 1
Left = 2160
TabIndex = 1
Top = 3480
Width = 855
End
Begin VB.CommandButton Command1
Caption = "放大"
Height = 375
Index = 0
Left = 840
TabIndex = 0
Top = 3480
Width = 855
End
Begin VB.Image Image1
Height = 3120
Index = 1
Left = 120
Top = 120
Width = 5295
End
End
Attribute VB_Name = "frmzoom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const ratio_small As Single = 0.5
Private Const ratio_large As Single = -1
Private Sub zoom(ByVal image As image, ByVal ratio As Single)
image.Stretch = True
image.Left = image.Left + image.Width * ratio / 2
image.Top = image.Top + image.Height * ratio / 2
image.Width = image.Width - image.Width * ratio
image.Height = image.Height - image.Height * ratio
End Sub
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
zoom Image1(1), ratio_large
Case 1
zoom Image1(1), ratio_small
Case 2
Unload Me
End Select
End Sub
Private Sub Form_Load()
Image1(1).Picture = LoadPicture(frmMain.CmDlg1.FileName)
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -