Gobillot
Messages postés3140Date d'inscriptionvendredi 14 mai 2004StatutMembreDernière intervention11 mars 201934 11 févr. 2005 à 00:42
pour le 1°) prévoir un Timer d'interval très faible, plus c'est faible plus c'est rapide.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
Dim x As Integer
If GetAsyncKeyState(37) < 0 Then
x = Image1.Left
If x > 0 Then Image1.Left = x - 15
End If
If GetAsyncKeyState(39) < 0 Then
x = Image1.Left
If (x + Image1.Width) < Me.Width Then Image1.Left = x + 15
End If
If GetAsyncKeyState(38) < 0 Then
x = Image1.Top
If x > 0 Then Image1.Top = x - 15
End If
If GetAsyncKeyState(40) < 0 Then
x = Image1.Top
If (x + Image1.Height) < Me.Height Then Image1.Top = x + 15
End If
Gobillot
Messages postés3140Date d'inscriptionvendredi 14 mai 2004StatutMembreDernière intervention11 mars 201934 11 févr. 2005 à 00:54
pour le 2°)
' début de la feuille
Dim Pic1 As StdPicture
Dim Pic2 As StdPicture
' charge tes images au Load
Private Sub Form_Load()
Set Pic1 = LoadPicture("C:\IMAGES\avion.bmp")
Set Pic2 = LoadPicture("C:\IMAGES\bateau.bmp")
End Sub
' ensuite dans le Timer
If GetAsyncKeyState(13) < 0 Then Image1.Picture = Pic1
If GetAsyncKeyState(68) < 0 Then Image1.Picture = Pic2
Kami1357
Messages postés36Date d'inscriptionsamedi 21 juin 2003StatutMembreDernière intervention11 février 2005 11 févr. 2005 à 15:32
ok merci mais pour l'image ... Cela marchera même si je traite d'abord ces dernières pour obtenir une transparence ? ( API TransparentBlt )
Je positionne les images à 0,0 puis je les traites ( trace nom_de_limage ) puis je les repositionne....
Je sais pas si vous comprenez ce quej e veux dire mais voilà.. lol Si vous avez une autre méthode pour rendre des picturesBox transparents je suis preneur.