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. Simple Picture Control Usage

Simple Picture Control Usage

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

    Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry

    M D H 3 Replies Last reply
    0
    • J jerry1211a

      Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Try a pointer to a CStatic object :) Mark

      J 1 Reply Last reply
      0
      • M Mark Salsbery

        Try a pointer to a CStatic object :) Mark

        J Offline
        J Offline
        jerry1211a
        wrote on last edited by
        #3

        Ok.

        M 1 Reply Last reply
        0
        • J jerry1211a

          Ok.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          That is the type of control placed on the dialog. You can set a bitmap into it in the designer or at runtime with CStatic::SetBitmap()

          1 Reply Last reply
          0
          • J jerry1211a

            Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry

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

            By default, the control has an id of IDC_STATIC. Change that to something else. Then use ClassWizard (Ctrl+W) to associate a CStatic object to that control. Then you can call the SetBitmap() method.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

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

            J 1 Reply Last reply
            0
            • D David Crow

              By default, the control has an id of IDC_STATIC. Change that to something else. Then use ClassWizard (Ctrl+W) to associate a CStatic object to that control. Then you can call the SetBitmap() method.


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

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

              J Offline
              J Offline
              jerry1211a
              wrote on last edited by
              #6

              Thank you for your help. Jerry

              1 Reply Last reply
              0
              • J jerry1211a

                Hello. I have added a picture control to my dialog application resource file. I dont know how to access it at run time. I thought you would need a pointer, in the same way you access a Edit control: CEdit *p = GetDlgItem(IDC_EDT); p->whatever, etc. So I need a pointer to the control I assume in order to send an image to it. Can anyone help. Jerry

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                Static control is good for show picture but why you want to use Edit Ctrl


                WhiteSky


                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