Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CommandBar SetIconId = Blank image
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBar SetIconId = Blank image

 Post Reply Post Reply
Author
Message
sdancer75 View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2008
Location: Greece
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdancer75 Quote  Post ReplyReply Direct Link To This Post Topic: CommandBar SetIconId = Blank image
    Posted: 20 October 2014 at 4:21am
Hi,

I am trying to change an image icon to a CXTPControl in the command bars but instead I get blank image. The code I use is that is shown below :

CXTPControl *m_pAttachmentControl;
...............
m_pAttachmentControl = pGroup->Add(xtpControlButton, IDS_BUTTON_ATTACHMENT);
m_pAttachmentControl->SetStyle(xtpButtonIconAndCaptionBelow);


..................

if (CheckIfExistFileProjects()) {
m_pAttachmentControl->SetIconId(IDB_PNG_ATTACHMENT_FULL);
m_pAttachmentControl->RedrawParent();
} else {

m_pAttachmentControl->SetIconId(IDB_PNG_ATTACHMENT_EMPTY);
m_pAttachmentControl->RedrawParent();
}

What seems to be the problem in my code ?

Regards,

Just me!
Back to Top
sdancer75 View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2008
Location: Greece
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdancer75 Quote  Post ReplyReply Direct Link To This Post Posted: 22 October 2014 at 7:54am
Ok,

What did I find. I found that 

XTPImageManager()->SetIcons(........) converts PNG or BMP files to Icons

BUT

XTPImageManager()->SetIcon(....) and PControl->SetIconId expects exclusively ICONS without the option to convert other formats (like png or bmp) to Icons. 

So if you try to use XTPImageManager()->SetIcon(....) with PNG your get Blank Dreams !

Any recommendations ?

Regards,


Just me!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.