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. Loading a Bitmap Dynamically in CStatic

Loading a Bitmap Dynamically in CStatic

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelplearning
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.
  • S Offline
    S Offline
    Sivaraman Dhamodaran
    wrote on last edited by
    #1

    Hi, I am having a property page ( Dialog resource) and it contains a Cstatic Instance. I need to load a bitmap on it dynamically and can anybody help me which of Override or Message should I handle to do it.. * The bitmap is in the Resource form IDB_ANYBMP * After Loading the Bitmap into the CBitmap Instance and calling the CStatic::SetBitmap Function. The above Algo is working once the dialog is displayed. But I need to display the bitmap before the dialog get displayed. Thanks in Advance

    K C D 3 Replies Last reply
    0
    • S Sivaraman Dhamodaran

      Hi, I am having a property page ( Dialog resource) and it contains a Cstatic Instance. I need to load a bitmap on it dynamically and can anybody help me which of Override or Message should I handle to do it.. * The bitmap is in the Resource form IDB_ANYBMP * After Loading the Bitmap into the CBitmap Instance and calling the CStatic::SetBitmap Function. The above Algo is working once the dialog is displayed. But I need to display the bitmap before the dialog get displayed. Thanks in Advance

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      I think you could try overloading OnInitInstance() and doing the processing there. The code in OnInitInstance() gets called before the dialog is displayed (I think).

      this is this.

      S 1 Reply Last reply
      0
      • K khan

        I think you could try overloading OnInitInstance() and doing the processing there. The code in OnInitInstance() gets called before the dialog is displayed (I think).

        this is this.

        S Offline
        S Offline
        Sivaraman Dhamodaran
        wrote on last edited by
        #3

        Hi Thanks for the Reply. I used Initinstance and also tried with OnSetActive (WizardPage). But it is not working.

        1 Reply Last reply
        0
        • S Sivaraman Dhamodaran

          Hi, I am having a property page ( Dialog resource) and it contains a Cstatic Instance. I need to load a bitmap on it dynamically and can anybody help me which of Override or Message should I handle to do it.. * The bitmap is in the Resource form IDB_ANYBMP * After Loading the Bitmap into the CBitmap Instance and calling the CStatic::SetBitmap Function. The above Algo is working once the dialog is displayed. But I need to display the bitmap before the dialog get displayed. Thanks in Advance

          C Offline
          C Offline
          Christopher Duncan
          wrote on last edited by
          #4

          Rather than the CWinApp::OnInitInstance(), put it in your CDialog::OnInitDialog() handler and it should work for you.

          Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

          1 Reply Last reply
          0
          • S Sivaraman Dhamodaran

            Hi, I am having a property page ( Dialog resource) and it contains a Cstatic Instance. I need to load a bitmap on it dynamically and can anybody help me which of Override or Message should I handle to do it.. * The bitmap is in the Resource form IDB_ANYBMP * After Loading the Bitmap into the CBitmap Instance and calling the CStatic::SetBitmap Function. The above Algo is working once the dialog is displayed. But I need to display the bitmap before the dialog get displayed. Thanks in Advance

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Sivaraman Dhamodaran wrote:

            ...it contains a Cstatic Instance. I need to load a bitmap on it dynamically...

            See here.


            "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

            "Judge not by the eye but by the heart." - Native American Proverb

            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