PDA

Click to See Complete Forum and Search --> : drawing on the desktop


fwaggle
Jan 16th, 2000, 08:05 AM
i've been messing around with some graphics and stuff, painting pixels onto forms... now my weird brain's decided i want to paint pixels straight onto the screen, without putting a form up...

i can do it fine copying the contents of the screen to a form.. but i want to paint directly onto the screen, so that i can still click icons and such around it...

i've tried getting the desktop window's dc, and using that as an argument for the ellipse function (which works fine on a form) but it just doesn't paint anything..

a friend who programs in delphi's told me i need to create a "canvas" first, but i'm lost...

thanks in advance for any hints or help

Fox
Jan 16th, 2000, 02:14 PM
You can use following code (copy functions from the API):

-

Dim DC as Long

DC = GetWindowDC( GetDesktopWindow )

-

Hope this helps

------------------
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.

fwaggle
Jan 16th, 2000, 03:55 PM
mmmm thanks for the answer but i already know how to get the dc and stuff =\

i still haven't figured it out.. i went away and tried some more.... i can paint anything and everything onto stupid forms but i wanna paint right on the screen....

thanks anyway

Fox
Jan 16th, 2000, 06:07 PM
Yes, if you have the DC stored youu can use functions like SetPixel (API) to draw directly on the 'desktop'. (this DC is like the screen directly, not sure if always)

------------------
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.

KENNNY
Jan 18th, 2000, 03:42 AM
i've got some code that does exactly what your are looking for :)
mail me and if u want it

------------------
cintel rules :p
www.cintelsoftware.co.uk