Hi all

My program currently loads a bitmap (given a filename) and draws it to a window (win32 application).

The problem is that once a different bitmap is loaded and drawn to the window... if the new bitmap is smaller than the old bitmap, the edges of the old bitmap are still visible once the new bitmap is drawn.
I need a way to completely clear the window before drawing each new bitmap. ... How do I do this??

Here is where I paint the window...

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    switch (message)                
      case WM_PAINT:
              HDC hDC = GetDC(hwnd);
              if (cd->GetFilename() != NULL) cd ->DrawBits(hDC,0,0);
              ReleaseDC(hwnd, hDC);
        //handle other messages

... where cd is the CDib*. (my bitmap class)

Each time the user loads a new bitmap to display, I call cd->LoadBitmapFile(filename).

12 Years
Discussion Span
Last Post by Ancient Dragon
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.