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. CStatusBarCtrl::SetIcon() problem with icon size

CStatusBarCtrl::SetIcon() problem with icon size

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • B Offline
    B Offline
    Baris Kurtlutepe
    wrote on last edited by
    #1

    Hi everybody, I'm trying to show an icon in one of the status bar's panes. The status bar is the CStatusBarCtrl and the problem is that I can only show 32x32 icons in the pane. When I load a 16x16 icon and call SetIcon() the icon on the statusbar becomes stretched to 32x32 in size, thus loses visibility of the most parts because the statusbar itself is about 18 or 19 pixels high. The workaround I've found is to create a 32x32 icon and place my 16x16 icon in the middle of that space and everything's fine. What am I doing wrong? Or is it that the 32x32 icons are the only ones one can display in a status bar pane? Any help would be greatly appreciated... P.S: The icons that I'm using are for the WindowsXP platform and thus 32bit icons, 24 bit colour and 8 bit transparency, maybe that's a problem?

    M 1 Reply Last reply
    0
    • B Baris Kurtlutepe

      Hi everybody, I'm trying to show an icon in one of the status bar's panes. The status bar is the CStatusBarCtrl and the problem is that I can only show 32x32 icons in the pane. When I load a 16x16 icon and call SetIcon() the icon on the statusbar becomes stretched to 32x32 in size, thus loses visibility of the most parts because the statusbar itself is about 18 or 19 pixels high. The workaround I've found is to create a 32x32 icon and place my 16x16 icon in the middle of that space and everything's fine. What am I doing wrong? Or is it that the 32x32 icons are the only ones one can display in a status bar pane? Any help would be greatly appreciated... P.S: The icons that I'm using are for the WindowsXP platform and thus 32bit icons, 24 bit colour and 8 bit transparency, maybe that's a problem?

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      When a 16x16 gets stretched to 32x32 it's usually caused by calling LoadIcon() instead of LoadImage(), or using incorrect size parameters in LoadImage(). --Mike-- "So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber

      B 1 Reply Last reply
      0
      • M Michael Dunn

        When a 16x16 gets stretched to 32x32 it's usually caused by calling LoadIcon() instead of LoadImage(), or using incorrect size parameters in LoadImage(). --Mike-- "So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber

        B Offline
        B Offline
        Baris Kurtlutepe
        wrote on last edited by
        #3

        LoadImage() worked, thank you very much. I thought I tried LoadImage() without success before, but then I must have given incorrect parameters to it. And I didn't know that LoadIcon() stretches the bitmap to system metrics, thanks again.

        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