well, to write a C++ prog. do it like this with VC++
Code: Select all
#include "stdafx.h"
#include <Magick++.h>
using namespace std;
using namespace Magick;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "crop a image" << endl;
cout << "---------------------------------" << endl;
int iRet = 0;
Image image;
Geometry frame;
string fileName(argv[1]); // todo: test argv[1] != null
try {
image.read(fileName);
frame.width(100);
frame.height(100);
frame.xOff(50);
frame.yOff(50);
image.crop(frame);
image.write(filename);
iRet = 0;
}
catch(exception &error_) {
cout << error_.what() << endl;
iRet = 1;
}
catch(...) {
cout << "Unknown exception occurred" << endl;
iRet = 1;
}
return iRet;
}
Compare http://redux.imagemagick.org/discussion ... php?t=3671
Thats it, nothing more.
Good luck, teetanne