用VS2008编了个程序,想读入个图片,然后对图片进行处理,但是在读入图片的时候出错
#include"stdafx.h"
#include
#include
usingnamespacestd;
usingnamespaceMagick;
intmain(intargc,char**argv)
{
InitializeMagick(*argv);
//Constructtheimageobject.Seperatingimageconstructionfromthe
//thereadoperationensuresthatafailuretoreadtheimagefile
//doesn'trendertheimageobjectuseless.
Imageimage;
try{
//Readafileintoimageobject
stringstdu="01-42.gif";
image.read(stdu);
//readImages(&image,"01-42.gif");
//Croptheimagetospecifiedsize(width,height,xOffset,yOffset)
//image.crop(Geometry(100,100,100,100));
//Writetheimagetoafile
//image.write("x.gif");
}
catch(Exception&error_)
{
cout
在image.read(stdu);这里出错
错误信息:read.exe中的0x770115de处未处理的异常:0xC0000005:读取位置0x00000000时发生访问冲突
网上说这种是指针出错,但是我看了几个ImageMagick的程序,都是这样用
求解答
分 -->
|