Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I convert a 1D byte array of a Bitmap into a 2D byte array?

AinStinAinStin Kolkata, IndiaMember Posts: 2

I have written a test program and loaded a PNG image into it,

https://dotnetfiddle.net/XHwp7o

Pixel format = 32 bit color
Resolution of the Bitmap,
Width = 512 pixels
Height = 512 pixels
Stride of the Bitmap = 2048 pixels
Offset or Padding = (Stride - Width) = (2048 - 512) = 1336 pixels.
Size of the 1D byte array = 1048576 bytes

What would be the dimensions if we convert the Bitmap to a 2D array?

How can I convert a 1D byte array of a Bitmap into a 2D byte array of the same Bitmap?

Tagged:
Sign In or Register to comment.