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. How can draw a line in mouse move ?

How can draw a line in mouse move ?

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

    I want to draw a line inside my view window.When i will left click in the view window the line should expand according to my mouse move and when i will right click the line should be drawn from the left click point to the right click point(before that no line should be drawn) how can i do that ? manoj Kumar Dalei, IIT Delhi

    S 1 Reply Last reply
    0
    • M muna_utkal

      I want to draw a line inside my view window.When i will left click in the view window the line should expand according to my mouse move and when i will right click the line should be drawn from the left click point to the right click point(before that no line should be drawn) how can i do that ? manoj Kumar Dalei, IIT Delhi

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      Handle the WM_LBUTTONDOWN and WM_RBUTTONDOWN messages, saving the points at which these occur, then in your WM_PAINT handler (or OnDraw if MFC) just use GDI calls (or CDC members) to do the line drawing. Check out the SCRIBBLE tutorial if you're using MFC. Steve S [This signature space available for rent]

      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