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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
mbatra
Posts: 18
Joined: 2012-05-29T08:37:10-07:00
Authentication code: 13

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

Post 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,
Alan Hadley
Posts: 48
Joined: 2010-03-31T12:17:55-07:00
Authentication code: 8675308

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

Post 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
2049651
Posts: 29
Joined: 2015-10-20T07:29:42-07:00
Authentication code: 1151

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

Post 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?
Post Reply