Image cropping help me

I'm going to make an application. The user will select an image. Then, with an extension I specify, it will crop to fit the screen perfectly. Can you help me?

For example, it looks like this.

What exactly do you need help with?

Taifun