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
|
procedure TForm1.FormCreate(Sender: TObject);
begin
SetLength(FBitmap, ClientWidth * clientHeight);
BorderStyle := bsSizeable;
Index := 0;
BMPSources[Index] := tBitMap.Create;
// BMPSources[Index].PixelFormat := pf32bit; <- ne sert à rien le LoadFromFile écrasera cette valeur
BMPSources[Index].LoadFromFile(ExtractFilePath(Application.ExeName) + 'HK.bmp');
Angles[Index] := -30;
// FPixelsI[Index] := TBitmap.Create; <-- fuite de mémoire, RotaBMP remplace ce bitmap !
// FPixelsI[Index].Assign(BMPSources[Index]); <-- intuile
Positions[Index].X := 100; Positions[Index].Y := 64;
// FPixelsI[Index] := RotaBMP(FPixelsI[Index], Positions[Index], Index, Angles[Index], FALSE); <-- du coup on utilise BMPSource
FPixelsI[Index] := RotaBMP(BMPSources[Index], Positions[Index], Index, Angles[Index], FALSE);
inc(Index);
BMPSources[Index] := tBitMap.Create;
// BMPSources[Index].PixelFormat := pf32bit;
BMPSources[Index].LoadFromFile(ExtractFilePath(Application.ExeName) + 'HQ.bmp');
Angles[Index] := 30;
// FPixelsI[Index] := TBitmap.Create;
// FPixelsI[Index].Assign(BMPSources[Index]);
Positions[Index].X := 400; Positions[Index].Y := 64;
FPixelsI[Index] := RotaBMP(BMPSources[Index], Positions[Index], Index, Angles[Index], FALSE);
end;
...
try
with Result do begin
TransparentColor := TransColor; // ouch !!! clCardinalToColor(PCardinal(BMP.ScanLine[0]));
TransparentMode := Bmp.TransparentMode; |
Partager