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. C / C++ / MFC
  4. Updating Different Areas of a Control

Updating Different Areas of a Control

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
2 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    Mark Lenz
    wrote on last edited by
    #1

    I have a control which displays information in 3 different places on itself. When one piece of information changes, I have to repaint the whole control. Sometimes, only one piece of information changes many times very quickly, so I end up re-drawing the whole control for everytime. Is there a way to mark a region or part of a control that needs to be re-drawn, not the whole thing? -Mark Lenz

    M 1 Reply Last reply
    0
    • M Mark Lenz

      I have a control which displays information in 3 different places on itself. When one piece of information changes, I have to repaint the whole control. Sometimes, only one piece of information changes many times very quickly, so I end up re-drawing the whole control for everytime. Is there a way to mark a region or part of a control that needs to be re-drawn, not the whole thing? -Mark Lenz

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2
      1. Call CWnd::InvalidateRect() and pass it the RECT of the area that needs to be redrawn.
      2. In your painting code, check the DC's invalid region (it's a CDC or API function, I can't remember the name ATM) and only repaint that region.

      --Mike-- http://home.inreach.com/mdunn/ While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate. :love: your :bob: with :vegemite: and :beer: Sonork - 100.10414 AcidHelm

      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