public static int[] GetPixelDataIntArgb(this Bitmap bm)
{
BitmapData data = bm.LockBits(
new Rectangle(0, 0, bm.Width, bm.Height),
ImageLockMode.ReadOnly,
PixelFormat.Format32bppArgb);
int pixels = data.Width * data.Height;
int[] argbValues = new int[pixels];
System.Runtime.InteropServices.Marshal.Copy(data.Scan0, argbValues, 0, pixels);
bm.UnlockBits(data);
return argbValues;
}