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. Bitmap for dialog background questions

Bitmap for dialog background questions

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

    I am using a bitmap for a dialog background, which works fine. I am also doing some GDI drawing on top of the bitmap. The problem is updating the GDI drawing causes the bitmap to blink. On a slower computer this may be a major annoyance. The bitmap is loaded in the OnPaint() message handler, where the GDI drawing is also performed and updated. I have tried loading the bitmap image only once, but when the GDI drawing is updated, the bitmap background is erased and not replaced. Is it possible to load the bitmap once, and not have it erased in OnPaint() when the GDI drawing is updated?

    _ 1 Reply Last reply
    0
    • F frqftgbdafr

      I am using a bitmap for a dialog background, which works fine. I am also doing some GDI drawing on top of the bitmap. The problem is updating the GDI drawing causes the bitmap to blink. On a slower computer this may be a major annoyance. The bitmap is loaded in the OnPaint() message handler, where the GDI drawing is also performed and updated. I have tried loading the bitmap image only once, but when the GDI drawing is updated, the bitmap background is erased and not replaced. Is it possible to load the bitmap once, and not have it erased in OnPaint() when the GDI drawing is updated?

      _ Offline
      _ Offline
      _Flaviu
      wrote on last edited by
      #2

      Have you tried to not call default OnEraseBackground ? Something like that:

      BOOL CYourDlg::OnEraseBkgnd(CDC* pDC)
      {
      return TRUE;
      // return CDialog::OnEraseBkgnd(pDC);
      }

      F 1 Reply Last reply
      0
      • _ _Flaviu

        Have you tried to not call default OnEraseBackground ? Something like that:

        BOOL CYourDlg::OnEraseBkgnd(CDC* pDC)
        {
        return TRUE;
        // return CDialog::OnEraseBkgnd(pDC);
        }

        F Offline
        F Offline
        frqftgbdafr
        wrote on last edited by
        #3

        Yes, I found that in a book last night, and it works! Thank you

        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