Clearing the screen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shades234
    New Member
    • Aug 2006
    • 29

    #1

    Clearing the screen

    I'm using ms visual c++ writing a SDI dbase program. i have a dc that creates a bunch of circles. however, if i scroll the screen the i'mages "remain" on the screen, i.e. they ghost. and they overwrite any text or anything on the screen. I was wondering if there was a way to erase those marks?

    and if not, how can i gain access to the minimize and restore buttons in the upper right side of the toolbar?

    thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    When you scroll the window someone should be calling an Invalidate function to cause the screen to redraw. 1 of the options to those functions is an erase background option. If this is not set the the new stuff is just drawn over the old.

    Sounds to me like you need to set this option.

    Comment

    • shades234
      New Member
      • Aug 2006
      • 29

      #3
      Originally posted by Banfa
      When you scroll the window someone should be calling an Invalidate function to cause the screen to redraw. 1 of the options to those functions is an erase background option. If this is not set the the new stuff is just drawn over the old.

      Sounds to me like you need to set this option.
      can you be a bit more specific?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Hmmm, the the circles are on top of the text it is because they are being drawn there, if they are underneath the text it is because they are not being erased.

        If you want to redraw a piece of the screen then you call a function like

        CWnd::Invalidat e( BOOL bErase = TRUE );

        This (ultimately) causes a WM_PAINT message to be sent to the Window andthe window to be re-drawn. If you supply this function with a bErase parameter set to FALSE then it doesn't erase what was alread in the window and you end up overwritting it with the new stuff.


        On the other hand if the circles are on top then it is more likely that where you draw the circles is not taking account of the fact that the Window is scrolled and is drawing them at an absolute position on the Window so over-writting the text.

        Comment

        • shades234
          New Member
          • Aug 2006
          • 29

          #5
          alright, i think i got it.

          thankx

          Comment

          Working...