This project has moved. For the latest updates, please go here.

offset values not working for MagickGeometry

Aug 5, 2014 at 12:25 AM
Hello,

I'm passing offset (x, y) values like image.Extend(new MagickGeometry(x, y, width, height)) but it does not apply offset to the image. Neither - or + values.

Am I missing something?

Best,
Kerem
Coordinator
Aug 5, 2014 at 12:49 PM
I can reproduce the issue. You should specify a negative value but Magick++ always make this positive. I will have to fix this in ImageMagick. I don't really understand why it needs to be negative so I have asked one of the other developers of ImageMagick why this needs to be negative. I will get back to you when I have an answer.
Aug 5, 2014 at 12:53 PM
Thank you, hope to see the fix soon.

By this time do you have a recommendation for applying offset to images?
Coordinator
Aug 5, 2014 at 7:20 PM
You could do the following as a temporary workaround:
using (MagickImage image = new MagickImage(@"logo:"))
{
  using (MagickImage background = new MagickImage(new MagickColor("yellow"), 800, 800))
  {
    background.Composite(image, 10, 10);
    background.Write("combined.png");
  }
}
Aug 6, 2014 at 1:25 AM
Yes, this worked. Thanks.