I'm trying to write the image data of an Image object into a char array. My code looks like the following:
The problem is that my image is a 1-channel black & white image so the map parameter "RGB" won't work. The documentation says that I can only use a combination of "R", "G", "B", "A", "C", "Y", "M" and "K" and I don't know what I should do when I have a B&W image. I tried to give only "R" or "K" but I get a wrong result (my image gets replicated 16 times in the width*height frame).
Code: Select all
char* block = (char*)malloc(widthTV*heightTV); mgkim.write(0,0,widthTV,heightTV,"RGB",CharPixel,block);
Is there any solution for this? Am I missing something?
Thanks in advance,