How to scale the image through scripting so that the height of the image will be equal to the height of the screen and the width of the image will be scaled with the same percentage?

Any help would be very much appreciated.

i have the options for canvas screen size if don scripting
if need scripting i dot know haw to changes options or this size

Provided the image is big enough to scale downwards, you can maintain the aspect ratio of the image with the height & width properties of the Screen class.