Best resize and or crop logic

前端 未结 2 1872
轻奢々
轻奢々 2021-01-05 16:29

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

相关标签:
2条回答
  • 2021-01-05 16:47

    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.

    0 讨论(0)
  • 2021-01-05 16:58

    This is probably a bit more involved than what you need, but for an example of some advanced cropping techniques, check this out.

    0 讨论(0)
提交回复
热议问题