Page 1 of 1

how to use ImageMagick for VC++(MFC) applications.?

Posted: 2012-08-01T23:45:42-07:00
by mbatra
Hi,

I am successfully able to use magick++ in C++ console applications. But I have issues regarding use of Magick++ to use in VC++ (MFC) apps. I have used simple code to read an image using magick++. But read function throws an exception of "Access violation writing location...".

<code>
Image image;
image.read("D:\\smile.gif");
image.rotate(145);
image.write("D:\\modified.gif");
</code>


Have anyone used ImageMagick library for vc++ apps.?

Regards,

Re: how to use ImageMagick for VC++(MFC) applications.?

Posted: 2012-08-02T12:57:41-07:00
by Alan Hadley
I do not use Magick++, but use MagickCore for windows programming. But I had a similar problem although I do not know if this applies to you but here goes.

My app uses Wide (2 byte) characters, IM uses multibyte characters. I do not know if the Magick++ wrappers take care of this but if not here is what I use to do the convertion

WideCharToMultiByte(CP_UTF8,0,&files[offset],MAX_PATH,ii->filename,MAX_PATH,0,0);

If you need to use this you will need to change '&files[offset]' to the original path and 'ii->filename' to a buffer to hold the converted string.

Alan Hadley

Re: how to use ImageMagick for VC++(MFC) applications.?

Posted: 2015-10-25T20:59:51-07:00
by 2049651
Dear mbatra,

I have same problems with yours.
I think you might have sloved now.

Would you please let me know how to solve?