Now that we have a thumbnail image, we need to perform two additional steps before saving it to local storage:
- The first thing we need to do is resize the image so that it fits the screen size. As you may recall, we make a square image based on the maximum dimension, which is based on either the screen's height or the screen's width. It is easy to resize the NativeImage instance because you already have a dedicated resize method for this very purpose.
- The second step is to crop the image. When we take a screenshot of the whole screen area, our users may only want a portion of the screen or a frameless and transparent window. Therefore, we need to crop it and leave only the rectangle based on the window boundaries.
The NativeImage class allows us to perform method chaining. This allows us to call multiple methods before we convert the...