Hi, What I am looking for is probably quite simple, but I couldn't figure out a simple way to do it from the C / wand interface:
I have an image of size say 2000x1500. it has been taken with a camera and its orientation is vertical (so the image size is really 1500x2000 if I look at it corectely). I want to rotate the image and resize it, keeping its proportions, so that it still fits in a 2000x1500 canvas and I want to image in the center of the canvas. There would be 2 black/transparent areas of the same size on each side of the image (this is the behaviour you expect of any program visualizing a vertical image) //I could rotate the image using: MagickRotateImage(magick_wand,pixel, 90); //I could resize it using MagickScaleImage(magick_wand, 1500,1125) //scale 0.75%, keeping proportion... any better way? command line interface has a option for this... //I could re-resize the canvas to 2000x1500 using: MagickSetImageExtent(magick_wand, 2000,1500) But then, the image is on the top left corner on the Canvas... Not in the middle: the only way I worked around this was to create an new want with an new 2000x1500 canvas and to use MagickCompositeImage to place manually the image at the correct location... Is there really no better way to do that? I tryed setting the image gravity: MagickSetImageGravity(magick_wand,CenterGravity); before resizing the Canvas, but with no difference in the result... What is the gravity used for? how should I do want I want?... Am I missing some documentation? (The C want interface documentation is very empty...) Thanks for you answers /Christophe. _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
