[vb 2008] Picture Spin?

Status
Niet open voor verdere reacties.

Dummy1912

Gebruiker
Lid geworden
26 mrt 2010
Berichten
362
Hallo,

Iemand die me kan helpen met het spinnen van een picturebox en wanneer ik deze stopt moet de picturebox blijven staan in die positie?

ik maak een game spin the bottle :D

maar het lukt me niet
dit is de code dat ik al heb.

Code:
Private Sub Button1_Click(ByVal sender As Object, _
                        ByVal e As EventArgs) Handles Button1.Click
        Me.Refresh()
        Timer1.Enabled = True

    End Sub

    Private Sub Form1_Paint(ByVal sender As Object, _
                        ByVal e As PaintEventArgs) Handles Me.Paint
        With e.Graphics
            'Shift the origin to the centre of the form.
            .TranslateTransform(Me.ClientSize.Width \ 2, Me.ClientSize.Height \ 2)

            'Rotate the frame of refence.
            .RotateTransform(CInt(Me.NumericUpDown1.Value))
            'Position the image so that it is concentric with the form.
            Dim bounds As Rectangle = New Rectangle(-Me.img.Width \ 2, _
                                                    -Me.img.Height \ 2, _
                                                    Me.img.Width, _
                                                    Me.img.Height)

            'Draw the image.
            .DrawImage(Me.img, bounds)
        End With
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        NumericUpDown1.Value = NumericUpDown1.Value + 50
        Me.Refresh()
    End Sub

please iemand

bedankt

Dummy1912
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan