Page 1 of 1

MagickGetPage usage

Posted: 2010-09-13T07:25:55-07:00
by mlin@pelmorex.com
Hi
I have tried to get the image size from the following code, but it does not give me the right values to me (the result value is 0, 0), the code is as follows:
MagickWandGenesis();
image=NewMagickWand();
status = MagickReadImage(image, srcimage);
MagickGetPage(image, &width, &height, &x, &y);
printf(after get page, size is: %d %d\n", (int)width, (int)height);

any suggestion on what is wrong here?

btw, I used the identify command and found the images have right geometry settings such as 256x256+0+0. the images are either png or tga format

Re: MagickGetPage usage

Posted: 2010-09-13T08:40:55-07:00
by el_supremo
I use

Code: Select all

    width = MagickGetImageWidth(mw);
    height = MagickGetImageHeight(mw);
I think MagickGetPage has something to do with the virtual canvas rather than the actual image dimensions.
Pete

Re: MagickGetPage usage

Posted: 2010-09-13T10:22:21-07:00
by mlin@pelmorex.com
el_supremo wrote:I use

Code: Select all

 width = MagickGetImageWidth(mw);
height = MagickGetImageHeight(mw);
I think MagickGetPage has something to do with the virtual canvas rather than the actual image dimensions.
Pete
Thanks Pete. Greate help. MagickGetImageWidth works for me.