Wie funktioniert BOOL CPhotovoltaikView::OnEraseBkgnd(CDC* pDC) ?



  • Habe die Funktion in meinem Programm:

    BOOL CPhotovoltaikView::OnEraseBkgnd(CDC* pDC) 
    {
    	return TRUE;
    }
    

    Ich weiß, dass sie für einen stabilen Hintergrund sorgt, aber was macht sie genau? Danke



  • The framework calls this member function when the CWnd object background needs erasing (for example, when resized). It is called to prepare an invalidated region for painting.

    The default implementation erases the background using the window class background brush specified by the hbrBackground member of the window class structure.

    If the hbrBackground member is NULL, your overridden version of OnEraseBkgnd should erase the background color. Your version should also align the origin of the intended brush with the CWnd coordinates by first callingUnrealizeObject for the brush, and then selecting the brush.

    An overridden OnEraseBkgnd should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If it returns 0, the window will remain marked as needing to be erased. (Typically, this means that the fErase member of the PAINTSTRUCT structure will be TRUE.)

    Windows assumes the background is computed with the MM_TEXT mapping mode. If the device context is using any other mapping mode, the area erased may not be within the visible part of the client area.



  • Gibt es da auch eine Erklärung in Deutsch?
    (sonst hänge ich den restlichen tag an der übersetzung)



  • ne sorry also übersetzen werd ich dir das jetzt nicht, wenn man programmiert sollte man schon ein wenig englisch können. Allein schon wegen so sachen wie Codeproject oder Codeguru und wie sie alle heißen.
    Wenn du glück hast steht in meiner MSDN zu Hause was auf deutsch (da hab ich die deutsche VC++Version drauf). Dann kann ich es dir auf deutsch schreiben. Aber die paar Zeilen kann man schon verstehen!
    Vielleicht noch als Tip:
    Wenn du ein bestimmtes Wort nicht weißt schau hier im Wörterbuch


Anmelden zum Antworten