public static void Array1DFromBitmap(Bitmap bmp)
{
if (bmp == null) throw new NullReferenceException("Bitmap is null");
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData data = bmp.LockBits(rect, ImageLockMode.ReadWrite, bmp.PixelFormat);
IntPtr ptr = data.Scan0;
int w = bmp.Width;
int h = bmp.Height;
int numInts = w * h;
Int32[] ints = new Int32[numInts];
System.Runtime.InteropServices.Marshal.Copy(ptr, ints, 0, numInts);
ptr = data.Scan0;
for (int i = 0; i < numInts; i++) ints[i] = 0x7f202020;//<---tutaj alpha jest max 0x7f
System.Runtime.InteropServices.Marshal.Copy(ints, 0, ptr, numInts);
bmp.UnlockBits(data);
}
nie daje się cast z uint na int gdy >0xf7