Results 1 to 10 of 12

Thread: TBItmap scanline

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    @Lifepower : thanks , i also didn't swap the color
    so this is the correct code

    Code:
    procedure SetScanLinePixel(x,y: integer; c : cardinal; var _bmp : TBitmap);
    type
      pRGBTripleArray = ^TRGBTripleArray;
      TRGBTripleArray = array[0..32768-1] of TRGBTriple;
    var
      raw : pRGBTripleArray;
    begin
      raw := _bmp.ScanLine[y];
      raw[x].rgbtRed    :=  ( c and $ff);  
      raw[x].rgbtGreen :=   ( c shr 8 ) and $ff;
      raw[x].rgbtBlue   :=  ( c shr 16) and $ff;  
    end;
    Last edited by AirPas; 21-09-2011 at 08:50 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •