drawing on the desktop

Started by
7 comments, last by let_bound 16 years, 9 months ago
hello, im trying to create a drawing application that can capture the desktop (with animation, meaning desktop actualization) and be able to paint on it like windows Paint. its a software for teachers to be able to run an application and activate it when needed, pick some color and draw on on top of desktop.. anyone have any ideas on how this can be done ? thanks
Advertisement
If using the .NET framework class library, you have Graphics.CopyFromScreen to capture and extract data from the screen.

A full-screen, always-on-top, colour-keyed form might also work.

Which language/API/framework are you intending on using?

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

hi,
we are using Qt & C++, and one thing we do need is multiplatform support, so i cant be based on windows calls.
Quote:Original post by murderv
hi,
we are using Qt & C++, and one thing we do need is multiplatform support, so i cant be based on windows calls.
I very much doubt you'll find a platform independant way of doing something as platform dependant as drawing to the dektop. It's not really the sort of thing most people try to do, so most (all?) platform independant libraries won't have functionality for it.

I'm not trying to say that it's impossible, but IMO it's very unlikely.
well maybe i will need to check which platform we're running, but still we have to work this out.
still i would like your ideas/opinions on this.

we tried one way in windows, that was to capture the screen and then do a setMask.. im not Qt pro but i think what it does is a transparent "layer" on top of all windows and draw where we moved our mouse..

the thing is it is too slow.. lets say about 5 FPS..

so im looking for some ways or tricks to get this working at decent framerate, so cases like drawing a cross does not fail. in one second you can draw a simple cross, but are we able to capture screen, draw that cross and keep the idea of refreshing background ?

anyone ?
You can't do this multi-platform. How will you get background of a text console?

QT is a windowing system. What you want is outside of that. You'll need to support each platform independently.

The whole concepts seems weird through. What happens when desktop icons get in the way? Or if the window manager doesn't support moving the icons? Or if another application is using desktop for its own purposes (Linux windowing systems are a flexible like hell)?

Create a window, maximize it. Cross-platform, reliable, conceptually reasonable. But hacking the background, apart from being non-portable, is also very problematic from user perspective, since it's completely counter-intuitive. It'll also result in lots of frustration as they try to draw something, but run into windows, icons, and other common GUI elements.



ok, multiplatform does not include text console OS.
by multiplatform i meant macintosh, windows xp,vista, and some linux windowing os.. i thought i did not have to say textmode wasnt included..

so i guess there arent many ideas about this?

thanks anyway
I looked into this for Windows a short while back, and your best bet is to create a transparent window and draw into that.

It should also be possible to create a rendering context using the device context of the desktop and draw to it then, but all my attempts resulted in a BSOD. I tried to use OpenGL to draw to it. Probably a bad idea to start with.

Then there is a way of using GDI+ and creating a graphics object from the device context of the desktop. This did work, but I could not get the window to redraw/clear itself properly. So everything I drew on the desktop stayed on the desktop until I moved something over it that forced a buffer refresh.

Again, I think your best bet, for Windows at least, is to use a transparent Window that covers the whole desktop.
STOP THE PLANET!! I WANT TO GET OFF!!
Quote:Original post by murderv
hi,
we are using Qt & C++, and one thing we do need is multiplatform support, so i cant be based on windows calls.


AFAIK Qt allows drawing to the desktop widget on X11 only, with the QDesktopWidget class. With other backends, you're essentially on your own.

This topic is closed to new replies.

Advertisement