문제

I have strange error using Magick++. Error occures in the line with calling method write(). When i use this method like this:

Image image( "176x144", "white" );
image.write("1.png");

no errors, and image is written well. BUT, when i trying to make many images like this:

Image image( "176x144", "white" );
for(int i=0; i<10; i++)
image.write((char)i + ".png");

i have unhandled exception ErrorMissingDelegate. I surfed over the internet to find smth about this, but i found only that this exception is caused by missing libs for png, but in first case, png image was made, so i have no idea what it is about.

Can you help me with some ideas about that?

도움이 되었습니까?

해결책

'(char)i + ".png"' is a memory address pointing to somewhere (not random, but not intended, too)

You might do:

std::ostringstream s;
s << i << ".png";
image.write(s.str());
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top