Example #1
0
        public MemImage(Image img)
            : this(img.Width, img.Height)
        {
            using (UnsafeBitmap bmp = new UnsafeBitmap(img))
            {
                bmp.LockBitmap();

                Parallel.For(0, Height, j =>
                {
                    //for (int j = 0; j < Height; j++)
                    //{

                    for (int i = 0; i < Width; i++)
                    {
                        PixelData pixelInput = bmp.GetPixel(i, j);
                        array[i][j] = pixelInput;
                    }
                    //}
                });
                bmp.UnlockBitmap();
            }
        }