Assign all the RGBA value in one go, that would reduce the inner loop by 4 times. i.e.:
var PixelPtr: PLongWord; PixelRowPtr: PByte; begin PixelRowPtr := Fbmp.RawImage.Data; for Y := 0 to Self.Height - 1 do begin PixelPtr := PLongWord(PixelRowPtr); for X := 0 to (Self.Width - 1) div 4 do begin PixelPtr^ := (lRed shl 24) or (lGreen shl 16) or (lBlue shl 8) or 255; Inc(PixelPtr); end; Inc(PixelRowPtr, FBmp.RawImage.Description.BytesPerLine); end; end; -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Slow-pointer-assignments-tp4030759p4030762.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus