0
votes

I have a Gdiplus::Bitmap object. It's a greyscale image of known width and height. What I want to do is to load it's contents into 2D array, like

char image[width][height]

I need both Gdiplus::Bitmap (to render in Winapi window) and the char array (to perform lot of image filtering and do it relatively fast). I considered some options:

  1. Iterate through Gdiplus::Bitmap, pixel by pixel to load data
  2. Load Gdiplus::Bitmap using new Gdiplus::Bitmap(filename) but use some other library to load image from the same file to my array
  3. Not use Gdiplus at all and use something else to render and perform filtering on image. Unfortunatelly, I don't know if there is a better way to render image in Winapi window than Gdiplus

What is the best way?

1

1 Answers

1
votes

If you use e.g. this constructor or this constructor, then you are still in control of the raw pixel data, and can change it as you please.

After changing the pixel data, just redraw using the bitmap and it should work.