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 paint the CTreeCtrl transparently?

How to paint the CTreeCtrl transparently?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 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
    Martial Spirit
    wrote on last edited by
    #1

    :confused:I'm curious of how to paint the CTreeCtrl transparently, this means how to create a CTreeCtrl in existed view without cover its content. just like CATIA's GUI, but I'm frustrated, I have no idea. Best Regards

    S 1 Reply Last reply
    0
    • M Martial Spirit

      :confused:I'm curious of how to paint the CTreeCtrl transparently, this means how to create a CTreeCtrl in existed view without cover its content. just like CATIA's GUI, but I'm frustrated, I have no idea. Best Regards

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      The tree control does not draw transparently. If you wish to make it appear otherwise, there are two feasible ways of doing so: 1) draw it yourself, and do it transparently. The control has a rich custom drawing API, and this is actually not too hard. The downside is, there's the possibility you'll forget to draw something correctly in an uncommon situation, or a new (or old) version of the tree will draw itself in a significantly different manner, leaving your custom-draw code producing very odd results. 2) let the tree draw itself onto an in-memory bitmap, then draw this bitmap to the screen while masking out the background color. This can be slower, and you really have to work to handle all the places where the tree tries to draw itself (hint: disable animated expand/collapse), but should be fairly bullet-proof once you're done with all that.

      You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

      M 1 Reply Last reply
      0
      • S Shog9 0

        The tree control does not draw transparently. If you wish to make it appear otherwise, there are two feasible ways of doing so: 1) draw it yourself, and do it transparently. The control has a rich custom drawing API, and this is actually not too hard. The downside is, there's the possibility you'll forget to draw something correctly in an uncommon situation, or a new (or old) version of the tree will draw itself in a significantly different manner, leaving your custom-draw code producing very odd results. 2) let the tree draw itself onto an in-memory bitmap, then draw this bitmap to the screen while masking out the background color. This can be slower, and you really have to work to handle all the places where the tree tries to draw itself (hint: disable animated expand/collapse), but should be fairly bullet-proof once you're done with all that.

        You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

        M Offline
        M Offline
        Martial Spirit
        wrote on last edited by
        #3

        I'll try to fullfill it, thanks for your helpful ideas. Best Regards

        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