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 / C++ / MFC
  4. Clearing CDC

Clearing CDC

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
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.
  • J Offline
    J Offline
    Jagadeesh VN
    wrote on last edited by
    #1

    Hi, Is there any way to clear the contents in CDC of a client window ? I have a transparent image in my CDC, and before drawing the next image, I would like to clear and reset the DC. Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

    L 1 Reply Last reply
    0
    • J Jagadeesh VN

      Hi, Is there any way to clear the contents in CDC of a client window ? I have a transparent image in my CDC, and before drawing the next image, I would like to clear and reset the DC. Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use the Invalidate(true)


      "Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill

      J 1 Reply Last reply
      0
      • L Lost User

        Use the Invalidate(true)


        "Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill

        J Offline
        J Offline
        Jagadeesh VN
        wrote on last edited by
        #3

        Hi, Thanks for the reply. I want to clear the CDC from inside OnPaint(). Calling Invalidate( ) of CWnd will again invoke the OnPaint. I am getting a DC inside OnPaint which contains an already painted image, which I would like to remove. I would like to draw a new Transparent image, But since the previous image is already there and the new image is transparent, I am having problems. Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

        J 1 Reply Last reply
        0
        • J Jagadeesh VN

          Hi, Thanks for the reply. I want to clear the CDC from inside OnPaint(). Calling Invalidate( ) of CWnd will again invoke the OnPaint. I am getting a DC inside OnPaint which contains an already painted image, which I would like to remove. I would like to draw a new Transparent image, But since the previous image is already there and the new image is transparent, I am having problems. Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

          J Offline
          J Offline
          Jack Puppy
          wrote on last edited by
          #4

          Is your background simple enough that you could just fill it with a background color? pDC->FillSolidRect(rect, RGB(255,0,0)); "When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest

          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