Screen sharing app

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
thomasrift
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Mar 07, 2018 2:03 am

Screen sharing app

Post by thomasrift »

Hello,

I would like to get started with wxWidget and I have the idea of creating kind of a fork of ShareX (that is a tool to take screenshot and share them very fast). But ShareX is not multi platform and only available on Windows.

Is it possible with wxWidgets to take screenshot (fullscreen, area screen etc) and is it possible to have it work for all platforms (Windows, Mac, Linux).

Thanks!
Last edited by thomasrift on Wed Mar 07, 2018 8:03 am, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Screen sharing app

Post by doublemax »

You can access the screen using wxScreenDC:
http://docs.wxwidgets.org/trunk/classwx_screen_d_c.html

Here is some sample code that saves a screenshot into a file:
viewtopic.php?p=32313#p32313
Use the source, Luke!
thomasrift
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Mar 07, 2018 2:03 am

Re: Screen sharing app

Post by thomasrift »

Thanks for the answer!

So I would be able to create an area selector like this with wxWidgets ? Would it be cross-platform ?

Image
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Screen sharing app

Post by doublemax »

Yes, wxScreenDC is available on all platforms. There is one limitation though under Windows ( i don't know about the other platforms ). If you have a hardware overlay window, e.g. used for 3d graphics or video display, that area can be black when grabbed from the wxScreenDC. You'll need platform specific code for this.

However, if necessary, you can just write the whole GUI, file management etc. in wxWidgets and use additional platform specific code for accessing the screen content.
Use the source, Luke!
User avatar
T-Rex
Moderator
Moderator
Posts: 1248
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Re: Screen sharing app

Post by T-Rex »

So I would be able to create an area selector like this with wxWidgets ?
Yes. Capture the screenshot, show the full screen winow and show this screenshot on this window with the area selector.
Would it be cross-platform ?
If you make it cross-platform, then, for sure, it will be. When using wxWidgets, you still can use the native APIs for everything. So, it will depend on how you implement your app.
Post Reply