2009-02-23

Snapshotting and cropping widget

I wrote simple Qt widget that is able to take an image of its own contents, and then crop it. (I use it with a video player widget to allow the user to take a snapshot of the video stream.) You can find it at the repo. It's not perfect, but it's what I need. Feel free to extend it, the mob access is open.

As an example (no code at all, all designer point-and-click), consider the following window:

Now if you click the "Snap" button (which is connected to the CropWidget's snap(bool) slot), the controls are no longer interactive (and are, in fact, just images of controls). You can use your mouse instead to draw a crop rect:

And then, by clicking "Crop" (connected to crop(), simple), get it... you guessed it ;)

No comments: