CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    14

    [gdi] Erasing Window

    Hello everyone!
    My problem is this:
    Code:
    case WM_PAINT:
    		{
    			PAINTSTRUCT ps;
    			HDC hdc = BeginPaint(imagine_aux, &ps);
    
    			
    				
    			        RestoreDC(hdc,-1);//reinitializez fereastra, cum era inainte de desenat
    				
    				HDC hdcMem = CreateCompatibleDC(hdc);
    				SelectObject(hdcMem, imagine_bmp);
    
    				GetObject(imagine_bmp, sizeof(bm), &bm);
    
    				BitBlt(hdc, image_x, image_y, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);//redesenez imaginea
    
    				//SelectObject(hdcMem, hbmOld);
    				DeleteDC(hdcMem);
    		
    			EndPaint(hwnd, &ps);
    			break;
    		}
    I am sending InvalidateRect from another function. What i want to do is this:
    Erase the current window (imagine_aux), then send RestoreDc to get the initial image.
    So after a HBITMAP was loaded, i save the dc, when it was moved, i simply want to delete everything and redraw the bitmap in the new position.
    The bitmap loads, the image is moved, but the window isnt't reinitialised , so i get the trail.
    Last edited by zorro59; June 21st, 2010 at 06:01 AM.

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