I have a public Image member in my class. When i push a button in my gui, i want to read an image from disk..
but i receive an "Access violation writing" exception in my callback function. Below is a pseudocode of the application.
Code: Select all
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
class X
{
public:
X();
~X();
Image img;
}
void X::mycallback()
{
try {
img.read("cat.bmp");
img.write("out.jpg");
}
catch( Exception &error_ ) {
cout << "Caught exception: " << error_.what() << endl;
return;
}
}
In the debug mode, the exception is thrown on "img.read" line.
Any idea is appreciated.
Regards,