title: Delphi TBitmap - why are Pixels and ScanLine different?
body: <p>While using a 32 bit TBitmap, I switched from Canvas.Pixels to ScanLine.</p>
  
  <p>I then set the value to Red, only to find it was displayed as blue.</p>
  
  <p>Any idea why?</p>
  
  <p>Here's a code excerpt:</p>
  
  <pre><code>procedure TForm1.FormPaint(Sender: TObject);
  var
    varBitmap: TBitmap;
    pLock: PIntegerArray;
    iColor: integer;
  begin
    varBitmap := TBitmap.Create;
    varBitmap.PixelFormat := pf32bit;
    varBitmap.Width := 800;
    varBitmap.Height := 600;
  
    // Set Pixels to Red
    varBitmap.Canvas.Pixels[0, 0] := $0000FF;
  
    // Shows $FF0000 (blue)
    pLock := varBitmap.ScanLine[0];
    iColor := pLock[0];
    ShowMessageFmt('%x', [iColor]);
  
    // Set ScanLine to Red
    pLock[0] := $0000FF;
  
    // Displays a blue pixel
    Canvas.Draw(0, 0, varBitmap);
  end;
  </code></pre>
  
  <p>It seems that somehow TColor is not the same as what is in memory, but that makes no sense.</p>
  
  <p>Any suggestions welcome. ;)</p>