private void SetPixels(int[] pixels) { var image = new PixelUtil(_bitmap); image.LockBits(); int count = 0; for (int th = 0; th < _image.Height; th++) { for (int tw = 0; tw < _image.Width; tw++) { Color color = Color.FromArgb(pixels[count++]); image.SetPixel(tw, th, color); } } image.UnlockBits(); }