CImage filling
-
Hi there, I'm trying to use a CImage in order to display some images in a window. I can easily load an image with Load() method, but what I want now is to create a (w x h) image (easy) and fill it with a color. How can I do this? I tried to use the following:
for (int x=0; x < width; ++x) for (int y=0; y < height; ++y) img.SetPixel(x,y,RGB(...));
But of course, as I expected, it takes quite a few seconds to fill the image. Is there any faster way? Thanks, Themis -
Hi there, I'm trying to use a CImage in order to display some images in a window. I can easily load an image with Load() method, but what I want now is to create a (w x h) image (easy) and fill it with a color. How can I do this? I tried to use the following:
for (int x=0; x < width; ++x) for (int y=0; y < height; ++y) img.SetPixel(x,y,RGB(...));
But of course, as I expected, it takes quite a few seconds to fill the image. Is there any faster way? Thanks, ThemisCan you get the HBITMAP of the image and put it in a HDC ? Then you can fill it all in one go. Christian Graus - Microsoft MVP - C++
-
Can you get the HBITMAP of the image and put it in a HDC ? Then you can fill it all in one go. Christian Graus - Microsoft MVP - C++