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. Need to change the main icon of an SDI app with the new ribbon interface (with a transparent icon)

Need to change the main icon of an SDI app with the new ribbon interface (with a transparent icon)

Scheduled Pinned Locked Moved C / C++ / MFC
learningc++delphigraphicsadobe
5 Posts 2 Posters 1 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
    sashoalm
    wrote on last edited by
    #1

    It's the icon at the top-left that by default is MFC. The resource file for the icon is res\main.bmp It is a 26x26 32-bit bitmap. For the icon I have a png file that has transparency. My problem is how to change the icon while preserving the transparency of my original png. Since by default the bitmap is 32-bit I assume it supports transparency, but when I saved my icon as 32-bit bitmap from photoshop, the new icon simply wasn't displayed. If I save it as a 24-bit bitmap it is shown but there's no transparency of course, which is a big problem.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C 1 Reply Last reply
    0
    • S sashoalm

      It's the icon at the top-left that by default is MFC. The resource file for the icon is res\main.bmp It is a 26x26 32-bit bitmap. For the icon I have a png file that has transparency. My problem is how to change the icon while preserving the transparency of my original png. Since by default the bitmap is 32-bit I assume it supports transparency, but when I saved my icon as 32-bit bitmap from photoshop, the new icon simply wasn't displayed. If I save it as a 24-bit bitmap it is shown but there's no transparency of course, which is a big problem.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      sashoalm wrote:

      the new icon simply wasn't displayed

      - how do you mean that? It crashed? It was there but was fully transparent? Are you sure your 32 bit BMP had anything on its alpha channel?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Computers are evil, EVIL i tell you!! <

      S 1 Reply Last reply
      0
      • C Code o mat

        sashoalm wrote:

        the new icon simply wasn't displayed

        - how do you mean that? It crashed? It was there but was fully transparent? Are you sure your 32 bit BMP had anything on its alpha channel?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Computers are evil, EVIL i tell you!! <

        S Offline
        S Offline
        sashoalm
        wrote on last edited by
        #3

        No, no, it didn't crash. I meant that visually it wasn't there. There seemed to be something that was a bit whiter where the icon should have been, but overall the "jewel" was an empty circle with no icon inside it.

        There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

        C 1 Reply Last reply
        0
        • S sashoalm

          No, no, it didn't crash. I meant that visually it wasn't there. There seemed to be something that was a bit whiter where the icon should have been, but overall the "jewel" was an empty circle with no icon inside it.

          There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          Check the alpha channel of your BMP, maybe it's empty...

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Computers are evil, EVIL i tell you!! <

          S 1 Reply Last reply
          0
          • C Code o mat

            Check the alpha channel of your BMP, maybe it's empty...

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Computers are evil, EVIL i tell you!! <

            S Offline
            S Offline
            sashoalm
            wrote on last edited by
            #5

            My problem is solved now after some googling, thanks to this free tool[^] by Adam Najmanowicz which converts png files to 32-bit bitmaps while preserving transparency. It works great now :)

            There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

            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