No, there’s not a way to do this by using the_post_thumbnail()
, neither it’s recommended.
What you are looking for is cropping the images on the fly. This will cost heavy server resources, especially when you have a lot of images to work with.
But in theory, to do so, you can make a script that takes an image as input, crops the image using PHP, and then returns the image data without saving the actual file. But again, it’s expensive.