投稿者   (社会人) 投稿日時 2009/3/30 19:12:03
ちなみに絵柄を3つから4つに表示を変更するときには下記のようになります。

ublic Class Form1
    Dim iti As Integer
    Dim slot() As Integer = New Integer() {4, 3, 2, 1, 3, 0, 2, 4, 1} 'ImageList1の画像サイズは「80,80」


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PictureBox1.Image = New Bitmap(80, 320)
        iti = 0
        drawslot(PictureBox1, iti)

    End Sub
    Private Sub drawslot(ByRef pb As PictureBox, ByVal p As Integer)
        Dim i As Integer
        Dim g As Graphics = Graphics.FromImage(pb.Image)

        For i = 0 To 3
            g.DrawImage(ImageList1.Images(slot((p + i) Mod 9)), 0, 240 - i * 80)
        Next

        g.Dispose()
        pb.Invalidate()

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        iti = (iti + 1) Mod 9
        drawslot(PictureBox1, iti)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Enabled = True

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False

    End Sub
End Class