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. Graphic layers in VC++

Graphic layers in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
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.
  • F Offline
    F Offline
    Fred D
    wrote on last edited by
    #1

    hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred

    J C 2 Replies Last reply
    0
    • F Fred D

      hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      There's a lot of ways to handle this situation, depending on your specific requirements. If you are developing a dialog-based app (I'm assuming you use MFC), then a possibility (by no means the only one) is that you paint the background picture as the dialog background (see this post of mine that explains how to do it), and the icons and texts you can create them dynamically as CButtons and CStatics, respectively, having your dialog as their parent window. Then, depending on the layers you want to depict, you just have to show/hide the controls (you can store pointers to it on some arrays, one for each layer) with ShowWindow. Sorry for this vague explanation, but maybe it's enough to put you on the right track. Good luck. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      • F Fred D

        hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Draw the background in OnEraseBackground and then put the items in the layers into an array. In OnPaint, draw only the items in layers flagged as being visible. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001

        Sonork ID 100.10002:MeanManOz

        I live in Bob's HungOut now

        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