ImageEn, unit iexBitmaps

TIEBitmap.GetRow

TIEBitmap.GetRow


Declaration

function GetRow(Row: integer): pointer;


Description

Retrieves a pointer to the specified Row. Returned pointer is valid until the application calls FreeRow.
Just like Scanline if Location is ieMemory or ieTBitmap.

Note: For performance, the specified index is not checked for validity (exception will be raised if it is out-of-range).


Example

// Add random noise to image
var
  x, y: Integer;
  psi: PByte;
  ps: PRGB;
  bpp, shiftRange: Integer;
begin
  shiftRange := 30; // Apply +/- 30 to RGB values
  bpp := ImageEnView1.IEBitmap.BitCount div 8;
  for y := 0 to ImageEnView1.IEBitmap.Height - 1 do
  begin
    psi := ImageEnView1.IEBitmap.GetRow(y);
    for x := 0 to ImageEnView1.IEBitmap.Width - 1 do
    begin
      ps := PRGB(psi);

      ps^.r := blimit( ps^.r - shiftRange div 2 + Random( shiftRange ));
      ps^.g := blimit( ps^.g - shiftRange div 2 + Random( shiftRange ));
      ps^.b := blimit( ps^.b - shiftRange div 2 + Random( shiftRange ));

      inc(psi, bpp);
    end;
    ImageEnView1.IEBitmap.FreeRow(y);
  end;
  ImageEnView1.Update();
end;


See Also

 Scanline
 FreeRow
 GetSegment