byte XOR_MASK = 0xFF; BitmapData bmpData = backBuffer.LockBits(rect, ImageLockMode.ReadWrite, pFormat); for (int y = 0; y < bmpData.Height; y++) { byte* row = (byte *)bmpData.Scan0+(y*bmpData.Stride); for (int x = 0; x < bmpData.Width; x++) { row[x*4] = (byte)(row[x*4] ^ XOR_MASK); // Blue row[x*4+1] = (byte)(row[x*4+1] ^ XOR_MASK); // Green row[x*4+2] = (byte)(row[x*4+2] ^ XOR_MASK); // Red // Next byte Alpha value, leave intact } } // Unlock the bits. backBuffer.UnlockBits(bmpData);
For (int I = 0; I < picture.width) { For (int j = 0; j < picture.height; j++) { color C = picture.getpixel(I, j) Int x = C.ToArgb(); X = X ^ key(or whatever u want to xor against the value of x) C = Color.FromArgb(X); Picture.SetPixel(I, j, C); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)