Petite animation avec deux images

Description

Tout est dans le titre, on peut faire bouger une image, mais seulement avec deu images, si vous savez comment pour faire avec plus, et si il y a un moyen d'enregistrer, dites le moi...

Source / Exemple :


A PLACER DANS LA FORM1

Private Sub Command1_Click()
Text1.Text = "" + Dir1 + "\" + File1 + ""
End Sub

Private Sub Command2_Click()
Text2.Text = "" + Dir2 + "\" + File2 + ""
End Sub

Private Sub Command3_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "Valeures incorrectes", vbOKOnly + vbCritical, "Valeures incorrectes"
Else
Timer1.Enabled = True
Command5.Enabled = True
Command3.Enabled = False
End If
End Sub

Private Sub Command4_Click()
a = InputBox("Dites le nombre de millisecondes qu'il y aura entre les deux images :")
If IsNumeric(a) Then
Timer1.Interval = a
Timer2.Interval = a
Else
MsgBox "Ceci n'est pas une valeure numérique", vbOKOnly + vbCritical, "Valeure incorrecte"
End If
End Sub

Private Sub Command5_Click()
Timer1.Enabled = False
Timer2.Enabled = False
Command5.Enabled = False
Command3.Enabled = True
End Sub

Private Sub Command6_Click()
If Text1.Text = "" Then
MsgBox "Aucune image sélectionnée", vbOKOnly + vbCritical, "Aucune image"
Else
Form2.Show
End If
End Sub

Private Sub Command7_Click()
If Text1.Text = "" Then
MsgBox "Aucune image sélectionnée", vbOKOnly + vbCritical, "Aucune image"
Else
Form3.Show
End If
End Sub

Private Sub Dir1_Change()
File1 = Dir1
End Sub

Private Sub Dir2_Change()
File2 = Dir2
End Sub

Private Sub File1_DblClick()
Text1.Text = "" + Dir1 + "\" + File1 + ""
End Sub

Private Sub File2_DblClick()
Text2.Text = "" + Dir2 + "\" + File2 + ""
End Sub

Private Sub Form_Load()

End Sub

Private Sub Timer1_Timer()
selectedfile = File1.Path & "\" & File1.FileName
Form1.Image1.Picture = LoadPicture(selectedfile)
Timer2.Enabled = True
Timer1.Enabled = False
End Sub

Private Sub Timer2_Timer()
selectedfile = File2.Path & "\" & File2.FileName
Form1.Image1.Picture = LoadPicture(selectedfile)
Timer2.Enabled = False
Timer1.Enabled = True
End Sub

A PLACER DANS LE FORM2

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()
selectedfile = Form1.File1.Path & "\" & Form1.File1.FileName
Form2.Image1.Picture = LoadPicture(selectedfile)
End Sub

A PLACER DANS LA FORM3

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()
selectedfile = Form1.File2.Path & "\" & Form1.File2.FileName
Form3.Image1.Picture = LoadPicture(selectedfile)
End Sub

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.