How to create a DIB Bitmap from a Byte Array?
Posted: Thu Dec 06, 2018 2:54 pm
I have a byte array containing the "raw" data (i mean: the pixels) of a 4-bit-per-pixels grayscale image. I receive this data via RS232 from an old device and i can't change this. But I need to draw this image on a wxPanel.
I have an old code made with C++Builder 2006 which initialize a DIB bmp with a 16 color palette, and then it memcpy the array in it each time i receive a new image, convert to screen bpp while scaling it x3 and finally show it on the screen.
I need to do this with wxWidgets (and make it working in both Windows and Linux) but i'm struggling to find how to do the same.
How could i show that array of bytes as an image using wxWidgets 3.0.4?
Thanks.
I have an old code made with C++Builder 2006 which initialize a DIB bmp with a 16 color palette, and then it memcpy the array in it each time i receive a new image, convert to screen bpp while scaling it x3 and finally show it on the screen.
I need to do this with wxWidgets (and make it working in both Windows and Linux) but i'm struggling to find how to do the same.
How could i show that array of bytes as an image using wxWidgets 3.0.4?
Thanks.