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 do u allow user to "draw" in SDK

how do u allow user to "draw" in SDK

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 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.
  • T Offline
    T Offline
    Tim Zorn
    wrote on last edited by
    #1

    how do u create a dc over ur whole dialog window and allow a user to draw lines on it? help would be appreciated thx:)

    A J 2 Replies Last reply
    0
    • T Tim Zorn

      how do u create a dc over ur whole dialog window and allow a user to draw lines on it? help would be appreciated thx:)

      A Offline
      A Offline
      alex barylski
      wrote on last edited by
      #2

      Override the CDialog::OnPaint() Unless you really mean the WHOLE window in which case use GetWindowDC() It's frustrating being a genius and living the life of a moron!!!

      T 1 Reply Last reply
      0
      • A alex barylski

        Override the CDialog::OnPaint() Unless you really mean the WHOLE window in which case use GetWindowDC() It's frustrating being a genius and living the life of a moron!!!

        T Offline
        T Offline
        Tim Zorn
        wrote on last edited by
        #3

        ok, thx. now how do u allow the user to draw on it?

        1 Reply Last reply
        0
        • T Tim Zorn

          how do u create a dc over ur whole dialog window and allow a user to draw lines on it? help would be appreciated thx:)

          J Offline
          J Offline
          Jose Lamas Rios
          wrote on last edited by
          #4

          You could create a custom control that handled the drawing and then insert the control in the dialog. To enable drawing you need to handle mouse messages (button down, mouse move, button up, etc.) and draw in the window accordingly. You can look at Microsoft's scribble sample program to get ideas on how to do it. There are Win32 and .NET versions for this sample, and although they are intended as MFC tutorials, you can still use it to extract useful ideas. -- jlr http://jlamas.blogspot.com/[^]

          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