VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "VB6 例10-17  象素操作"
   ClientHeight    =   2595
   ClientLeft      =   2655
   ClientTop       =   1500
   ClientWidth     =   4935
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2595
   ScaleWidth      =   4935
   Begin VB.CommandButton Command4 
      Caption         =   "旋  转"
      Height          =   465
      Left            =   3540
      TabIndex        =   4
      Top             =   2040
      Width           =   1100
   End
   Begin VB.CommandButton Command3 
      Caption         =   "翻转放大"
      Height          =   465
      Left            =   2400
      TabIndex        =   3
      Top             =   2040
      Width           =   1100
   End
   Begin VB.CommandButton Command2 
      Caption         =   "水平翻转"
      Height          =   465
      Left            =   1260
      TabIndex        =   2
      Top             =   2040
      Width           =   1100
   End
   Begin VB.PictureBox Picture1 
      AutoSize        =   -1  'True
      Height          =   1395
      Left            =   3180
      Picture         =   "V6bj10-17.frx":0000
      ScaleHeight     =   1335
      ScaleWidth      =   1410
      TabIndex        =   1
      Top             =   120
      Width           =   1470
   End
   Begin VB.CommandButton Command1 
      Caption         =   "复  制"
      Height          =   465
      Left            =   120
      TabIndex        =   0
      Top             =   2040
      Width           =   1100
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim sw, sh      ' 设 sw, sh为图源宽,高

Private Sub Command1_Click()        '复制
    Cls
    Form1.PaintPicture Picture1, 0, 0
    '以下为完整语句格式
    'Form1.PaintPicture Picture1, 0, 0, sw, sh, 0, 0, sw, sh, vbSrcCopy
End Sub

Private Sub Command2_Click()        '水平翻转
    Cls
    ' 将原点设置到另一角(Picture1的右上角)
    PaintPicture Picture1, sw, 0, -sw
    '也可用下面的语句
    'Form1.PaintPicture Picture1, 0, 0, sw, sh, sw, 0, -sw, sh
End Sub

Private Sub Command3_Click()        '翻转放大
    ' 将原点设置到Picture1的左下角
    Cls
    Form1.PaintPicture Picture1, 0, 0, 1.5 * sw, 1.5 * sw, 0, sh, sw, -sh, vbSrcCopy
End Sub

Private Sub Command4_Click()        '旋转
    Dim i, j
    Cls
    For i = 1 To sw Step 15
      For j = 1 To sh Step 15
        Form1.PaintPicture Picture1, j, i, 15, 15, i, j, 15, 15
       ' PaintPicture Picture1, sw - j, i, -15, 15, i, j, 8, 15 '顺时针旋转90°的效果
      Next j
    Next i
End Sub

Private Sub Form_Click()
    Cls
End Sub

Private Sub Form_Initialize()
    sw = Picture1.ScaleWidth
    sh = Picture1.ScaleHeight
End Sub
