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. When I draw an image to a dialog using GDI+, controls are covered by the image

When I draw an image to a dialog using GDI+, controls are covered by the image

Scheduled Pinned Locked Moved C / C++ / MFC
graphicswinforms
5 Posts 4 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
    followait
    wrote on last edited by
    #1

    When I click them, they become visible again.

    void CMyDlg::OnPaint()
    {
    ...
    Graphics g(GetSafeHwnd());
    g.DrawImage(m_pMemBmp,0,0);
    }

    D I K 3 Replies Last reply
    0
    • F followait

      When I click them, they become visible again.

      void CMyDlg::OnPaint()
      {
      ...
      Graphics g(GetSafeHwnd());
      g.DrawImage(m_pMemBmp,0,0);
      }

      D Offline
      D Offline
      Don Box
      wrote on last edited by
      #2

      U should draw the image in response to

      WM_ERASEBKGND

      message

      Come online at:- jubinc@skype

      1 Reply Last reply
      0
      • F followait

        When I click them, they become visible again.

        void CMyDlg::OnPaint()
        {
        ...
        Graphics g(GetSafeHwnd());
        g.DrawImage(m_pMemBmp,0,0);
        }

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        I don't have any great experience with GDI+ as such, but it may help if you tick the "Clip children" style for your dialog box. Iain.

        F 1 Reply Last reply
        0
        • F followait

          When I click them, they become visible again.

          void CMyDlg::OnPaint()
          {
          ...
          Graphics g(GetSafeHwnd());
          g.DrawImage(m_pMemBmp,0,0);
          }

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          This is absolut correct. If you wish your image be drawn as background, you draw it in the OnEraseBkgrnd() handler.

          Greetings from Germany

          1 Reply Last reply
          0
          • I Iain Clarke Warrior Programmer

            I don't have any great experience with GDI+ as such, but it may help if you tick the "Clip children" style for your dialog box. Iain.

            F Offline
            F Offline
            followait
            wrote on last edited by
            #5

            Great, thanks.

            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