I\'ve come across this a few times and thought it would be good to put it out there. What\'s your best image resize and/or crop logic. The idea being that some method is c
I'd say you should utilize standard geometry types like Rectangle
and Size
. Then you should probably also support a use case, when the caller wants to fit the image in some larger rectangle, but still wants to keep the original image sizes ratio.
One way to implement the resizing you can find here.
This is probably a bit more involved than what you need, but for an example of some advanced cropping techniques, check this out.