Bonjour,

Je charche à stocker une image bitmap dans un tableau de TRGBTriple.
Avec le code suivant provoque une vioaltion d'accès à la ligne "for h to..."
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
procedure TForm6.Button1Click(Sender: TObject);
type
  pPixRow640x480 = ^TPixRow640x480;
  TPixRow640x480 = array[0..pred(640)] of TRGBTriple;
  pPixMape640x480 = ^TPixMape640x480;
  TPixMape640x480 = array[0..pred(480)] of pPixRow640x480;
var
  pPixMape: pPixMape640x480;
  BMP: TBitmap;
  h: integer;
begin
  BMP:= TBitmap.Create;
  try
    BMP.PixelFormat:= pf24bit;
    BMP.PixelFormat:= pf24bit;
    BMP.LoadFromFile('C:\1.bmp');
    for h:= 0 to BMP.Height-1 do pPixMape[h]:= BMP.ScanLine[h];
  finally
    BMP.Free;
  end;
end;
L'image est bien en 640x480. Où est l'erreur ?