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. MFC-a windows paint example, how do i do the text option

MFC-a windows paint example, how do i do the text option

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++tutorial
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.
  • L Offline
    L Offline
    lxxrya001
    wrote on last edited by
    #1

    like on windows paint, the text feature, where it places text anywhere on the painting surface, how would i do this ? and then, how would i add resizing properties to my rectagles lines and ellipses thanx smile...its your destiny :)

    S 1 Reply Last reply
    0
    • L lxxrya001

      like on windows paint, the text feature, where it places text anywhere on the painting surface, how would i do this ? and then, how would i add resizing properties to my rectagles lines and ellipses thanx smile...its your destiny :)

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

      CDC::TextOut() or any of the other variants. For the resizing you will have to hit test the mouse click against the list of items you draw, if it is within your hit test bounds then you have a hit and move to editing mode for the item. Store the details that you use to draw the item, and as the mouse moves, erase the item as it was, quick way to do it is via an XOR drawing operation. Draw the new item at the new position. On mouse up, commit the new positions to the store. You will have to worry about which item to select on the hit test. Think of each item being created as being on a stack, hit-test working down the stack. If two items are possible hits, then it is the more newly created (ie on top) item that will be selected. then you will have to do a move to back, bring to front mechanism, but that is simple. HTH, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

      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