Now Place:2uzhan.com » Drawing bitmap on window - how to clear window/HDC?

Drawing bitmap on window - how to clear window/HDC?

how to clear window/HDC? - Software Development @ February 26, 2006   Views:0

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).


erase the window -- get current window RECT object then call FillRect() with the desired color.

Write a java program that asks a person for his height (in meters) and weight (in kilograms) and
outputs one of the messages: underweight, normal, or obese, using the BMI ...

I'm attempting to simplify my fundraising page, and would like to show exactly how much each donation would help us out. I've listed the options below, but I would like ...

Before I get into the specific issues, I want to provide some other details:

  • Normally, I work on a live, paid server (even in dev); I realize that is ...
© 2018 2uzhan.com Contact