Results 1 to 5 of 5

Thread: drawing on the desktop

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    2

    Post

    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

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    You can use following code (copy functions from the API):

    -

    Dim DC as Long

    DC = GetWindowDC( GetDesktopWindow )

    -

    Hope this helps

    ------------------
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.



  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    2

    Post

    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

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    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)

    ------------------
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.



  5. #5
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    i've got some code that does exactly what your are looking for
    mail me and if u want it

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width