1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
BmpFond := TBitmap.Create;
//Chargement des images représentant le background
if Fchoix.rg1.itemindex = 6 then
BmpFond.LoadFromResourceName(hinstance, 'Fond');
If Fchoix.rg1.itemindex = 0 then
BmpFond.LoadFromResourceName(hinstance, 'Fond1');
If Fchoix.rg1.itemindex = 1 then
BmpFond.LoadFromResourceName(hinstance, 'Fond2');
If Fchoix.rg1.itemindex = 2 then
BmpFond.LoadFromResourceName(hinstance, 'Fond3');
If Fchoix.rg1.itemindex = 3 then
BmpFond.LoadFromResourceName(hinstance, 'Fond4');
If Fchoix.rg1.itemindex = 4 then
BmpFond.LoadFromResourceName(hinstance, 'Fond5');
If Fchoix.rg1.itemindex = 5 then
BmpFond.LoadFromResourceName(hinstance, 'Fond6');
BmpInvisible := TBitmap.Create;
BmpImage1 := TBitmap.Create;
BmpImage2 := TBitmap.Create;
BmpImage3 := TBitmap.Create;
BmpImage4 := TBitmap.Create;
BmpImage5 := TBitmap.Create;
//Background
BmpFond.Width := Pbscreen.Width;
BmpFond.Height := Pbscreen.Height;
BmpInvisible.Assign(BmpFond) ;
//Chargement des images représentant des boules de Noël
BmpImage1.LoadFromResourceName(hinstance, 'Corine');
BmpImage2.LoadFromResourceName(hinstance, 'Robert');
BmpImage3.LoadFromResourceName(hinstance, 'Patrick');
BmpImage4.LoadFromResourceName(hinstance, 'Jean');
BmpImage5.LoadFromResourceName(hinstance, 'Madeleine');
W := Bmpimage1.width;
H := Bmpimage1.height;
BmpImage1.Transparent := True;
BmpImage1.TransParentColor := BmpImage1.canvas.pixels[1, 1];
BmpImage2.Transparent := True;
BmpImage2.TransParentColor := BmpImage2.canvas.pixels[1, 1];
BmpImage3.Transparent := True;
BmpImage3.TransParentColor := BmpImage3.canvas.pixels[1, 1];
BmpImage4.Transparent := True;
BmpImage4.TransParentColor := BmpImage4.canvas.pixels[1, 1];
BmpImage5.Transparent := True;
BmpImage5.TransParentColor := BmpImage5.canvas.pixels[1, 1];
// initialisation
xx1 := 1;
yy1 := 1;
x1 := trunc(xx1);
y1 := trunc(yy1);
vx1 := 1.5;
vy1 := 0.5;
NewRect1 := bounds(x1, y1, W, H);
OldRect1 := NewRect1;
xx2 := 200;
yy2 := 100;
x2 := trunc(xx2);
y2 := trunc(yy2);
vx2 := 1.5;
vy2 := 0.5;
NewRect2 := bounds(x2, y2, W, H);
OldRect2 := NewRect2;
xx3 := 80;
yy3 := 280;
x3 := trunc(xx3);
y3 := trunc(yy3);
vx3 := 1.5;
vy3 := 0.5;
NewRect3 := bounds(x3, y3, W, H);
OldRect3 := NewRect3;
xx4 := 350;
yy4 := 250;
x4 := trunc(xx4);
y4 := trunc(yy4);
vx4 := 1.5;
vy4 := 0.5;
NewRect4 := bounds(x4, y4, W, H);
OldRect4 := NewRect4;
xx5 := 550;
yy5 := 350;
x5 := trunc(xx5);
y5 := trunc(yy5);
vx5 := 1.5;
vy5 := 0.5;
NewRect5 := bounds(x5, y5, W, H);
OldRect5 := NewRect5;
End; |
Partager