Page 1 of 1

[Closed] Rotating images before using image.Composite

Posted: 2017-08-08T13:39:23-07:00
by i73
Hello, I am trying to rotate some images before calling Composite on them (I am adding 6 images to a single image) wondering how best to do this, seeing how I am not having any luck:

I've tried the following:

Code: Select all

      
      //This does not rotate, I even tried writing the image right after. 
      MagickImage image = new MagickImage("MyImagePath");
      image.Rotate(rotation);

Code: Select all

     //This does not work either with the -rotate argument.
     image2.Composite(image, image.Width * x, image.Height * y, new CompositeOperator(), $"-rotate {rotation}");

Re: Rotating images before using image.Composite

Posted: 2017-08-08T14:09:17-07:00
by i73
For some reason rotate was not working with my original image, but now it is.. Thanks guys.

Re: [Closed] Rotating images before using image.Composite

Posted: 2017-08-14T10:02:27-07:00
by pablobhz
You need to store the rotated image somewhere

i.e:
MagickImage mysampleImage = new MagickImage(filePath);
mysampleImage = mysampleImage.Rotate(90);
mysampleImage.Write(@"C:\TEST\rotatedimage.png");

If you're working with multiple images (you said 6), why don't you create a List<MagickImage> or an MagickImageCollection, store them all there and then do your operations ; would be easier i think.

Just leaving my input :)

Bye !