asked on
Box |Width |Height
----|------|------
1 |357 |272
----|------|------
2 |357 |272
----|------|------
3 |365 |460
----|------|------
4 |365 |265
----|------|------
5 |715 |455
----|------|------
6 |360 |465
----|------|------
7 |360 |465
----|------|------
8 |360 |465
----|------|------
9 |540 |290
----|------|------
10 |540 |290
So visually it would look something like this: --------------------------
| | | |
| 1 | 2 | |
|----------------| 3 |
| | |
| |-------|
| 5 | |
| | 4 |
|------------------------|
| | | |
| 6 | 7 | 8 |
| | | |
|------------------------|
| | |
| 9 | 10 |
--------------------------
So what my goal is is to get the current image I am wanting to place into a box and get its width and height and from that determine the best box to place it in so that it will show the image:imgStream.Crop(width, height, Gravity.Center);
orMagickGeometry size = new MagickGeometry(width, height);
size.IgnoreAspectRatio = maintainAspectRatio;
// Adjust geometry offset to center of image (same as `-gravity Center`)
size.Y = imgStream.Height / 2 - height / 2;
size.X = imgStream.Width / 2 - width / 2;
imgStream.Crop(size);
So to sum up the above - I am in need of finding the best box to place the image into before I go and use Magick.NET on it.