Stride is 1440, it means one row of Scan0 consists of 480( 1440 / 3) pixels information.
To
memset
a portion of bitmap, I suggest to do like this,
BYTE* pbyFirstLine = (BYTE*) dataHigh.Scan0;
int nX_i = 10;
int nY_i = 10;
int nW_i = 10;
int nH_i = 10;
for(int nY = nY_i; nY < nY_i + nH_i; nY++)
{
BYTE* pbySeek = pbyFirstLine + ( nX_i * 3 ) + nY * dataHigh.Stride;
memset(pbySeek, 0xFF, 3 * nW_i );
}
Scan0 always return first pixel of Bitmap, This may be a bug of Gdi :)
According to msdn documentation,
Scan0: Gets or sets the address of the first pixel data in the bitmap. This can also be thought of as the first scan line in the bitmap.