CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    24

    Question Erasing the line drawn using CDC

    Hi,

    I draw a line using CDC's LineTo method. After sometime, I want to erase the line. I dont know how to do it. Is there any method in CDC by which we can erase a line or drawing segment?

    Thanks,
    Luke.

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  3. #3
    Join Date
    Mar 2007
    Posts
    157

    Re: Erasing the line drawn using CDC

    you can do it to draw a line using XOR brush

  4. #4
    Join Date
    Mar 2007
    Posts
    24

    Resolved Re: Erasing the line drawn using CDC

    Thank you both. It was helpful. I am doing it with the background color.

  5. #5
    Join Date
    Aug 2001
    Posts
    77

    Re: Erasing the line drawn using CDC

    What do you do if the background is set to transparent?

  6. #6
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Erasing the line drawn using CDC

    Quote Originally Posted by lukevprem View Post
    Thank you both. It was helpful. I am doing it with the background color.
    This is not going to work if you, for example, drew a second line across - you will erase an intersection point.
    The only proper way is to redraw everything except for the line you want to erase.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

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

Featured