In my code I load a 32-bit-depth PNG file (1 pixel 4 byte) into a byte array like this:
//Pick a file
OpenFileDialog FileValaszto = new OpenFileDialog();
FileValaszto.ShowDialog();
//Create BitmapImage
BeolvasottKep = new BitmapImage(new Uri(FileValaszto.FileName));
//Create byte array
stride = BeolvasottKep.PixelWidth * 4;
int size = BeolvasottKep.PixelHeight * stride;
MyPixelsArray = new byte[size];
BeolvasottKep.CopyPixels(pixels, stride, 0);
After I finish manipulating the pixels in "MyPixelsArray" I would like to save its data back into a new PNG image file. Only I can't...
I spent more than a day searching the net but there is no solution to this exact problem. Any help would be highly appreciated. Thanks!