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. OnDraw, how can I get the rectangle that is painting ?

OnDraw, how can I get the rectangle that is painting ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 26 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, OnDraw..., draws all the screen ?, or with InvalidateRect(...), draws only a portion of the screen ?, I call ScrollWindow ( in a scroll view), how can I get in the on Draw method the rectangle of the screen that will be new drawn ( not moved) ? Thanks, Bye ! Braulio

    H L 2 Replies Last reply
    0
    • L Lost User

      Hi, OnDraw..., draws all the screen ?, or with InvalidateRect(...), draws only a portion of the screen ?, I call ScrollWindow ( in a scroll view), how can I get in the on Draw method the rectangle of the screen that will be new drawn ( not moved) ? Thanks, Bye ! Braulio

      H Offline
      H Offline
      Henk Devos
      wrote on last edited by
      #2

      You receive this rectangle when you call BeginPaint in your WM_PAINT message handler. The classwizard adds this function for you. Note that your OnDraw will also be called for printing. ================== The original message was: Hi,

      OnDraw..., draws all the screen ?, or with InvalidateRect(...), draws only a portion of the screen ?, I call ScrollWindow ( in a scroll view), how can I get in the on Draw method the rectangle of the screen that will be new drawn ( not moved) ?

      Thanks, Bye !
      Braulio

      1 Reply Last reply
      0
      • L Lost User

        Hi, OnDraw..., draws all the screen ?, or with InvalidateRect(...), draws only a portion of the screen ?, I call ScrollWindow ( in a scroll view), how can I get in the on Draw method the rectangle of the screen that will be new drawn ( not moved) ? Thanks, Bye ! Braulio

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Use CDC::GetClipBox to get the area that needs to be repainted.

        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