I do aplogize if I do anything wrong. The same situation as with Magick++ Image::Extent() is with Image::Resize(). After applying Image::Resize() to my loaded document, and save it back, the image contains in original size. This is an example I did:
Magick::Image imageMyImage;
imageMyImage.read("F-16.jpg");
Magick::Geometry geometryExtend(1024, 2000, 0, 0);
imageMyImage.resize(geometryExtend);
imageMyImage.write("test.jpg");
"F-16.jpg" is a standard image being 1024x768 pixels large. After saving it back, it contained the original size 1024x768.
Version of Image Magick: ImageMagick-6.3.2.0-Windows.
Thank you,
Magick++ image::resize() - not working?
Re: Magick++ image::resize() - not working?
Thank you for the response above. Is there any way how to override aspect ratio when using Geometry(1024, 2000); which mean when I use parameters I receive above in the application.
Using your version it makex more difficult to insert the parameters into Geometry() structure, because, I have to firstly generate text array, such as "1024x2000!", that will be later used as parameter in Geometry() structure.
Best regards,
Rene
Using your version it makex more difficult to insert the parameters into Geometry() structure, because, I have to firstly generate text array, such as "1024x2000!", that will be later used as parameter in Geometry() structure.
Best regards,
Rene
Re: Magick++ image::resize() - not working?
I was experimenting and found the answer: Geometry.aspect(true); forces to override the aspect ratio. exactly as in the example below(myGeometry.aspect(true);):
Image imgTest(Geometry(200,200), "transparent");
imgTest.type(TrueColorMatteType);
Image imgCompose(Geometry(20,20), "red");
imgCompose.type(TrueColorMatteType);
Geometry myGeometry(200, 400);
myGeometry.aspect(true);
imgTest.resize(myGeometry);
imgTest.composite(imgCompose, 10, 10, OverCompositeOp);
imgTest.write("test.png");
Best regards..
Image imgTest(Geometry(200,200), "transparent");
imgTest.type(TrueColorMatteType);
Image imgCompose(Geometry(20,20), "red");
imgCompose.type(TrueColorMatteType);
Geometry myGeometry(200, 400);
myGeometry.aspect(true);
imgTest.resize(myGeometry);
imgTest.composite(imgCompose, 10, 10, OverCompositeOp);
imgTest.write("test.png");
Best regards..