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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to smooth drawing on the screen?

How to smooth drawing on the screen?

Scheduled Pinned Locked Moved C / C++ / MFC
javascriptgraphicstutorialquestion
3 Posts 3 Posters 0 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.
  • D Offline
    D Offline
    davilism
    wrote on last edited by
    #1

    I'm doing a Windows Paint-like application. I draw on the screen by capturing every mouse button-downs and moves, and then SetPixel(), the line drawn will be broken and I guess the Windows does not process the messages fast enough so some MouseMove do not react to every point the mouse moves. How does Windows Paint do that drawing on the screen without breaking? What should I do to smooth it?

    A T 2 Replies Last reply
    0
    • D davilism

      I'm doing a Windows Paint-like application. I draw on the screen by capturing every mouse button-downs and moves, and then SetPixel(), the line drawn will be broken and I guess the Windows does not process the messages fast enough so some MouseMove do not react to every point the mouse moves. How does Windows Paint do that drawing on the screen without breaking? What should I do to smooth it?

      A Offline
      A Offline
      Alexandru Savescu
      wrote on last edited by
      #2

      I believe you are partially right. I think windows does not miss a message, but WM_MOUSEMOVE is not sent for every pixel your mouse is over. Anyway use CDC::LineTo Best regards, Alexandru Savescu

      1 Reply Last reply
      0
      • D davilism

        I'm doing a Windows Paint-like application. I draw on the screen by capturing every mouse button-downs and moves, and then SetPixel(), the line drawn will be broken and I guess the Windows does not process the messages fast enough so some MouseMove do not react to every point the mouse moves. How does Windows Paint do that drawing on the screen without breaking? What should I do to smooth it?

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        davilism wrote: How does Windows Paint do that drawing on the screen without breaking? Probably it just connects the points with line segments. Depending on the speed of mouse movement, the line will be more or less jagged. Tomasz Sowinski -- http://www.shooltz.com

        - It's for protection
        - Protection from what? Zee Germans?

        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