Problems with image.read
Posted: 2018-01-10T08:43:06-07:00
Hi,
I am trying to create a software that converts a pdf into a bmp file. I am using visual studio 2017 to create a clr/c++ project.
The version of magick++ is ImageMagick-7.0.7-21-Q16 for (x86).
I have added and linked all the .h, .lib and .dll files, the code gets compiled without problems, but when I try to read a file it gives an exception (System.Runtime.InteropServices.SEHException: 'external component has thrown an exception').
This is the piece of code (is compiled under release(x86)):
msclr::interop::marshal_context context;
Magick::Image myImage;
//Choose the pdf
myImage.read(context.marshal_as<std::string>(openFileDialog1->FileName)); //Exception called here
//Write a bmp
myImage.write("file.bmp");
I have run the same code under release(x64), used the same library (but for x64), added and linked the .h and .lib files (it runs without the .dll files, instead of the x86 version, that without them would call a 0xc000007b error).
Sorry for my bad english
Best regards
I am trying to create a software that converts a pdf into a bmp file. I am using visual studio 2017 to create a clr/c++ project.
The version of magick++ is ImageMagick-7.0.7-21-Q16 for (x86).
I have added and linked all the .h, .lib and .dll files, the code gets compiled without problems, but when I try to read a file it gives an exception (System.Runtime.InteropServices.SEHException: 'external component has thrown an exception').
This is the piece of code (is compiled under release(x86)):
msclr::interop::marshal_context context;
Magick::Image myImage;
//Choose the pdf
myImage.read(context.marshal_as<std::string>(openFileDialog1->FileName)); //Exception called here
//Write a bmp
myImage.write("file.bmp");
I have run the same code under release(x64), used the same library (but for x64), added and linked the .h and .lib files (it runs without the .dll files, instead of the x86 version, that without them would call a 0xc000007b error).
Sorry for my bad english
Best regards