I would like to write a program to take a displayed image, and have a transparent rectangle on top of the image at a fixed aspect ratio. I want to have this rectangle be able to be moved and resized to visually select a portion of the underlying image, and then when done, export the selected part of the image to a file.
How would I go about this?