Why are you dividing Pitch by 4?
Try this instead:pDest := DWORD(d3drc.pBits) + nRow * d3drc.Pitch ;
pDest := @PByteArray(d3drc.pBits)[nRow * d3drc.Pitch]; // original pitch, not /4 oneThis is wrong too, you don't increase the address stored in pDest,inc(pDest^, $FF000000 or (r shl 16) or (g shl or b);
just the value it points to.
Did you write this code by converting from C++?
Bookmarks