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,
how to use ImageMagick for VC++(MFC) applications.?
-
- Posts: 48
- Joined: 2010-03-31T12:17:55-07:00
- Authentication code: 8675308
Re: how to use ImageMagick for VC++(MFC) applications.?
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
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.?
Dear mbatra,
I have same problems with yours.
I think you might have sloved now.
Would you please let me know how to solve?
I have same problems with yours.
I think you might have sloved now.
Would you please let me know how to solve?