Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Drawing on the Desktop

Drawing on the Desktop

Scheduled Pinned Locked Moved C#
graphicshelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bneacetp
    wrote on last edited by
    #1

    How would I go about capturing the user's desktop surface to use a Graphics object to draw on it? Thanks for the help in advance.


    John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." using Earth.Internet.WWW.CodeProject;

    J J 2 Replies Last reply
    0
    • B bneacetp

      How would I go about capturing the user's desktop surface to use a Graphics object to draw on it? Thanks for the help in advance.


      John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." using Earth.Internet.WWW.CodeProject;

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Perhaps this article[^] will help?

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Messianic Instrumentals (with audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      1 Reply Last reply
      0
      • B bneacetp

        How would I go about capturing the user's desktop surface to use a Graphics object to draw on it? Thanks for the help in advance.


        John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." using Earth.Internet.WWW.CodeProject;

        J Offline
        J Offline
        Jun Du
        wrote on last edited by
        #3

        Depending on your requirement, you have two options. Option 1 - Platform Invoke Win32 to obtain the desktop window. 1) Platform invoke a few Win32 calls from User32.dll, such as GetWindowDC() and GetDesktopWindow(). 2) Construct a graphics object based on the desktop window resource you obtained. 3) Use the constructed graphics object to draw. Option 2 - Use a transparent window to cover part or all of the desktop. 1) Create a transparent, no-border windows form. 2) Draw to that form. Best, Jun

        B 1 Reply Last reply
        0
        • J Jun Du

          Depending on your requirement, you have two options. Option 1 - Platform Invoke Win32 to obtain the desktop window. 1) Platform invoke a few Win32 calls from User32.dll, such as GetWindowDC() and GetDesktopWindow(). 2) Construct a graphics object based on the desktop window resource you obtained. 3) Use the constructed graphics object to draw. Option 2 - Use a transparent window to cover part or all of the desktop. 1) Create a transparent, no-border windows form. 2) Draw to that form. Best, Jun

          B Offline
          B Offline
          bneacetp
          wrote on last edited by
          #4

          Due to the fact that I want to maintain cross platform capability (in this case with Mono on platforms such as Linux and Mac OS), I think Option 2 is the better choice. Thanks.


          John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." using Earth.Internet.WWW.CodeProject;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups