Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Rect flickrs outside of the the app area

Rect flickrs outside of the the app area

Scheduled Pinned Locked Moved Graphics
help
2 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gabbana
    wrote on last edited by
    #1

    Hello, I have the following problem: I painted a rectangle with a text outside of my app on the screen in the WM_PAINT message. The Problem is that it flickrs very hard. The code I use:

    	hdc = GetDC(NULL);
    	SelectObject(hdc, GetStockObject(WHITE\_BRUSH));
    	RoundRect(hdc, 10, 10, 100, 40, 9, 9);
    	rc.left = 10;
    	rc.top = 10;
    	rc.right = 100;
    	rc.bottom = 40;
    	SetBkColor(ps.hdc, RGB(255,255,255));
    	DrawText(hdc,L"Hello",5, &rc, DT\_CENTER | DT\_VCENTER | DT\_SINGLELINE);
    	ReleaseDC(hWnd,hdc);
    

    I also tried using the WM_NCPAINT message but the it destroys the complete app frame. Thanks for help. bye, gabbana

    G 1 Reply Last reply
    0
    • G gabbana

      Hello, I have the following problem: I painted a rectangle with a text outside of my app on the screen in the WM_PAINT message. The Problem is that it flickrs very hard. The code I use:

      	hdc = GetDC(NULL);
      	SelectObject(hdc, GetStockObject(WHITE\_BRUSH));
      	RoundRect(hdc, 10, 10, 100, 40, 9, 9);
      	rc.left = 10;
      	rc.top = 10;
      	rc.right = 100;
      	rc.bottom = 40;
      	SetBkColor(ps.hdc, RGB(255,255,255));
      	DrawText(hdc,L"Hello",5, &rc, DT\_CENTER | DT\_VCENTER | DT\_SINGLELINE);
      	ReleaseDC(hWnd,hdc);
      

      I also tried using the WM_NCPAINT message but the it destroys the complete app frame. Thanks for help. bye, gabbana

      G Offline
      G Offline
      gabbana
      wrote on last edited by
      #2

      Okay i solved the problem with the double buffering system. I created a new DC and a Bitmap and draw into this dc and made an bit block transfer at the end into the right DC.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups