| 
Private Sub Timer1_Timer()
    Dim pw As Long, ph As Long 'コピー元の領域の幅,高さ
    Dim sx As Long, sy As Long '特定位置
    Static flag As Boolean
    pw = 32&: ph = 32& '&記号は長整数型の指定
    sx = 50&: sy = 50&
    hdc2 = Picture2.hDC: hdc3 = Picture3.hDC
    hdc4 = Picture4.hDC: hdc5 = Picture5.hDC
    hdc6 = Picture6.hDC: hdc7 = Picture7.hDC
    '2つの画像を交互に表示する
    If flag = False Then'1つ目の画像を表示
        '継続表示属性の時に描かれたものと、非継続表示属性
        'の時描かれたものとを区別する
        Picture1.AutoRedraw = True '継続表示属性にする
        '継続表示属性のデバイスコンテキストを得る
        hdc1 = Picture1.hDC
        BitBlt hdc4, 0&, 0&, pw, ph, hdc1, sx, sy, vbSrcCopy
        BitBlt hdc4, 0&, 0&, pw, ph, hdc3, 0&, 0&, vbSrcAnd
        BitBlt hdc4, 0&, 0&, pw, ph, hdc2, 0&, 0&, vbSrcPaint
        Picture1.AutoRedraw = False'非継続表示属性にする
        '非継続表示属性のデバイスコンテキストを得る
        hdc1 = Picture1.hDC
        BitBlt hdc1, sx, sy, pw, ph, hdc4, 0&, 0&, vbSrcCopy
    Else '2つ目の画像を表示
        Picture1.AutoRedraw = True
        hdc1 = Picture1.hDC
        BitBlt hdc7, 0&, 0&, pw, ph, hdc1, sx, sy, vbSrcCopy
        BitBlt hdc7, 0&, 0&, pw, ph, hdc6, 0&, 0&, vbSrcAnd
        BitBlt hdc7, 0&, 0&, pw, ph, hdc5, 0&, 0&, vbSrcPaint
        Picture1.AutoRedraw = False
        hdc1 = Picture1.hDC
        BitBlt hdc1, sx, sy, pw, ph, hdc7, 0&, 0&, vbSrcCopy
    End If
    flag = Not flag
End Sub
 |