I write the following code, and I find some black region in the result. It is not that I want to be cut. How can I write the code?
#include <Magick++.h>
#include <iostream>
#include <string>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick("C:\\Program Files\\ImageMagick-6.6.2-Q16\\");
Image image;
try {
string file_name0 = "d:\\test.jpg";
image.read(file_name0);
image.chop(Geometry(20,20));
image.crop(Geometry(60,50));
image.write("d:\\test0.gif");
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
The picture and reuslt as following:
test.jpg
http://mail.qq.com/cgi-bin/ftnExs_downl ... e=d81d27c1
test0.gif
http://mail.qq.com/cgi-bin/ftnExs_downl ... e=c5076ede