I have several items, i want to calculate a minimum rectangle in which they can be fit, but items are rotated to some degree, or skewed or both. So how do i get the least rectangle which can contain all ?
You can get the bounding Box for each item, calculate its four extreme points, then apply the transforms on them (skew, rotate, ...)
Then you can easily calculate the bounding box by computing the min and max x and y for all of these points.
Here is an link to an implementation of a Dynamic Canvas. This control automatically sizes itself to fit its contents, so the answer to your problem can be found in this code. Look at the MeasureOverride function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With