| mamo139 (17) | |||
|
ok, i would like to print a picture in a window. I think that the first step should be to transform the data i have into a DDB, device dependent bitmap... and then i can copy it in my windows using device contexts and BitBlt(). this image is not in a file, it is generated dinamically. i explain you whitch data i have: I have the size of the image, that is 640x400 and i know that the pixels are in the buffer char *bit24format; each pixel is rappresented by three bytes, in RGB format. so the structure of my array is pixel 1 red, pixel 1 green, pixel 1 blue, pixel 2 red, pixel 2 green, pixel 2 blue, pixel 3 red, .... etc.... so the size of the buffer will be 640*400*3 reading the msdn, I decided to solve the problem in this way, but it does not work, and the window display a black rectangle instead of my image. what is wrong?? thank you very much!!
| |||
|
|
|||
| guestgulkan (2560) | |
|
I wonder if this is pallette related - because DIB_PAL_COLORS meas to use colours as defined by the pallette currently selected into the device context - and you only appear to have the default pallette. I'm not sure what this bit24format[10]='\0'; doesand I think this SetDIBits(cdc, immagine, 1, 399, (void *) bit24format, &info, DIB_PAL_COLORS); should be SetDIBits(cdc, immagine, 0, 400, (void *) bit24format, &info, DIB_PAL_COLORS); | |
|
Last edited on
|
|