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. Relacing the image in CImageList contl

Relacing the image in CImageList contl

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

    I want to change replace old image with new image in the Imagelist at 9 index. So I have used the Relace function, In that the 3 parameter saying the Bitmap mask. that i couldn't understood. Pls provide me the example for replace a image in the image list. My actual aim is to change the toolbar button image, when i cliked that toolbar button. Provide me solution

    A N 2 Replies Last reply
    0
    • G gopalraja

      I want to change replace old image with new image in the Imagelist at 9 index. So I have used the Relace function, In that the 3 parameter saying the Bitmap mask. that i couldn't understood. Pls provide me the example for replace a image in the image list. My actual aim is to change the toolbar button image, when i cliked that toolbar button. Provide me solution

      A Offline
      A Offline
      ATM CodeProject
      wrote on last edited by
      #2

      Hi, I could't get ur real problem. Any way, i already tell that set hot and cold image list for tool bar.Hot image list is for the image when we focus on the toolbar button.

      G 3 Replies Last reply
      0
      • G gopalraja

        I want to change replace old image with new image in the Imagelist at 9 index. So I have used the Relace function, In that the 3 parameter saying the Bitmap mask. that i couldn't understood. Pls provide me the example for replace a image in the image list. My actual aim is to change the toolbar button image, when i cliked that toolbar button. Provide me solution

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        The mask bitmap is use to make some part of the original image transparent. Thie value have effect only if you have created the image list with flag ILC_MASK. But I think in your case rather than replacing the ICon in the image list, just change the icon index of the button using the CToolBar::SetButtonInfo() fuction.

        nave [OpenedFileFinder] [My Blog]

        G 1 Reply Last reply
        0
        • A ATM CodeProject

          Hi, I could't get ur real problem. Any way, i already tell that set hot and cold image list for tool bar.Hot image list is for the image when we focus on the toolbar button.

          G Offline
          G Offline
          gopalraja
          wrote on last edited by
          #4

          Pls give a example for replacing the image in the Image list using Replace method. the 3 parmateter of the Replace method saying some mask. that i couldn't udersttod. Example pls

          1 Reply Last reply
          0
          • A ATM CodeProject

            Hi, I could't get ur real problem. Any way, i already tell that set hot and cold image list for tool bar.Hot image list is for the image when we focus on the toolbar button.

            G Offline
            G Offline
            gopalraja
            wrote on last edited by
            #5

            I will explain my problem sir, I have three buttons in the toolbar with associated bitmapgreen, Red, Blue. Now When I clicked the Red button, that button color has to changed to Yellow color. Give me example

            1 Reply Last reply
            0
            • N Naveen

              The mask bitmap is use to make some part of the original image transparent. Thie value have effect only if you have created the image list with flag ILC_MASK. But I think in your case rather than replacing the ICon in the image list, just change the icon index of the button using the CToolBar::SetButtonInfo() fuction.

              nave [OpenedFileFinder] [My Blog]

              G Offline
              G Offline
              gopalraja
              wrote on last edited by
              #6

              Thank you

              1 Reply Last reply
              0
              • A ATM CodeProject

                Hi, I could't get ur real problem. Any way, i already tell that set hot and cold image list for tool bar.Hot image list is for the image when we focus on the toolbar button.

                G Offline
                G Offline
                gopalraja
                wrote on last edited by
                #7

                Thanks That problem is solved with the follosing code. hIcon = AfxGetApp()->LoadIcon(IDI_ICON1); m_wndToolBar.GetToolBarCtrl().GetImageList()->Replace(8,hIcon);

                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