Question

I have got a small problem. I need to use a few images, but I don't want to declare new 'image' for each of them. I declare image as: CImg image("1.bmp"); And after that, i would like sign for image other picture for example 2.bmp. Not sure, if I explained it well... i would like to do the same as below, but on images: int a =1; a=2;

I was looking in lib documentation, but I could not find anything. image=image("2.bmp") unfortunately is not working. Is there any way to solve my problem? I really dont want to declare image1, image2, image3 and so on.

Was it helpful?

Solution

use the assign() methods, they are equivalent to 'in-place' contructors :

CImg<> img("img1.bmp");
img.assign("img2.bmp");  // or img.load("img2.bmp");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top