cs_Nono40
Messages postés962Date d'inscriptionmercredi 3 avril 2002StatutMembreDernière intervention12 septembre 20062 21 sept. 2002 à 23:53
Au lieu de mettre Form1.Width et Form1.Height, utilise Form1.ClientWidth et Form1.ClientHeight. Ceci définit la taille de la zone utile, ce qui permet de faire rebondir Image1 exactement sur le bord sans utiliser Image1.Height*2 :
if (ValTX >= (Form1.ClientWidth - Image1.Width)) then ValX := -3;
if (ValTX = 1) then ValX := 3;
if (ValTY >= (Form1.ClientHeight - Image1.Height)) then ValY := -3;
if (ValTY = 1) then ValY := 3;
21 sept. 2002 à 23:53
if (ValTX >= (Form1.ClientWidth - Image1.Width)) then ValX := -3;
if (ValTX = 1) then ValX := 3;
if (ValTY >= (Form1.ClientHeight - Image1.Height)) then ValY := -3;
if (ValTY = 1) then ValY := 3;
Nono.