【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了Flip.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "翻转图片效果"
ClientHeight = 3750
ClientLeft = 45
ClientTop = 330
ClientWidth = 5145
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3750
ScaleWidth = 5145
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 420
Left = 3750
TabIndex = 3
Top = 3210
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "垂直翻转"
Height = 420
Index = 1
Left = 3750
TabIndex = 2
Top = 135
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "水平翻转"
Height = 420
Index = 0
Left = 3750
TabIndex = 1
Top = 630
Width = 1215
End
Begin
VB.PictureBox Picture1
AutoSize = -1 'True
Height = 3510
Left = 135
Picture = "Flip.frx":0000
ScaleHeight = 3450
ScaleWidth = 3450
TabIndex = 0
Top = 135
Width = 3510
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim bHort As Boolean
Dim bVert As Boolean
Private Sub Command1_Click(Index As Integer)
Dim pic As StdPicture
Set pic = Picture1.Picture
Picture1.Cls
Select Case Index
Case 0
bHort = Not bHort
Case 1
bVert = Not bVert
End Select
If bHort And bVert Then
Picture1.PaintPicture pic, Picture1.Width, Picture1.Height, _
Picture1.Width * -1, Picture1.Height * -1
ElseIf bHort And Not bVert Then
Picture1.PaintPicture pic, Picture1.Width, 0, _
Picture1.Width * -1, Picture1.Height
ElseIf Not bHort And bVert Then
Picture1.PaintPicture pic, 0, Picture1.Height, _
Picture1.Width, Picture1.Height * -1
Else
Picture1.PaintPicture pic, 0, 0
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub