defiant
defiant

Reputation: 3341

Qt Screenshot sharing app - How to select the area of a screen

I am trying to code an app in Qt for capturing and then sharing the screenshots. For now my application captures the screenshot, shows a preview and saves it. I am yet to do the upload part. but before that I would like to be able to select the area of the screen of which the screenshot needs to be captured.

I tried searching and I couldn't find any helpful articles or documents in Qt. So can anyone help me?

PS: The idea is to create a similar app like lightshot and several other similar tools.

Thanks in advance

Upvotes: 4

Views: 1601

Answers (1)

TheDarkKnight
TheDarkKnight

Reputation: 27611

There are two methods that you can use for this: -

1) Capture an image of the screen and then display that, full screen to the user, essentially allowing the user to crop the image.

2) A more commonly used method is to create a full-screen, topmost window that has no title bar and is transparent. This allows the user to drag out an area, which you can draw an outline to represent the area the user requires.

I recommend the 2nd method and creating a transparent window is simply a matter of changing the window flags, as you can see here.

Upvotes: 5

Related Questions