I have tested these code with ImageMagick-6.6.3.10 and ImageMagick-6.8.0.7, original portion of an image stays at top left corner of resulting image.
Code: Select all
#include <Magick++.h>
using namespace Magick;
int main(int argc, char **argv)
{
Image image;
image.read("62701.jpg");
image.resize(Geometry(460, 380));
image.extent(Geometry(460, 380), Color("white"), CenterGravity);
image.write("extent_62701.jpg");
return 0;
}