Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - XP Icons w diferent behaviour/Interfaces
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XP Icons w diferent behaviour/Interfaces

 Post Reply Post Reply
Author
Message
andre View Drop Down
Groupie
Groupie


Joined: 09 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote andre Quote  Post ReplyReply Direct Link To This Post Topic: XP Icons w diferent behaviour/Interfaces
    Posted: 30 August 2005 at 1:02pm

Hi,

 Why do some controls  implement the function SetImageList and some others do not ?

  How can I show XP icons in CXTPToolbar and CXTShortcutBar using the  CImageList that I use in other controls like CXTPTabControl ?

 Thank You

CImageList il;

// create image list with XP icons

//

// This works OK

CXTPTabControl.SetImageList( &il );

CXTPTaskPanel::SetImageList( &il );

// This shows a gray rectangle instead of the alpha layer...

CXTPToolBar::GetImageManager()->SetIcons( il, 0, 0, 0, xtpImageNormal);

CXTPShortcutBar::GetPaintManager()->SetIcons( il, 0, 0, 0, xtpImageNormal );

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2005 at 3:36am

Hello,

Are you sure your alpha bitmap is valid? As you can see ShortcutBar sample show Alpha bitmaps without problem.

I suggest you don't use CImagList with alpha images because it supoprted only by WinXP, but to add directly alpha bitmap to image manager. 

CXTPImaegManager::SetIcons(IDB_BITMAP,...)

it supports alpha images for all OS.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andre View Drop Down
Groupie
Groupie


Joined: 09 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote andre Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2005 at 8:07am

Hi Oleg,

I know CXTPShortcutBar show alpha bitmaps, I'm also using XP.

The problem is that not all controls show the ImageList the same way.

Anyway I do not know how to convert a XP icon file( check "super.ico" in attach ) to xtreme alpha bitmaps, can you please help out ?

This screenshot shows the diferences

2005-08-31_080639_icon_problem.zip

Thank you

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2005 at 2:18pm

What version do you have? If 9.70 use

CXTPImageManager::SetIcon(nIDResourceIcon, nIDCommand) method to add alpha icon supported for all OS.

Anyway check attached converted Alpha bitmap

2005-08-31_141650_super.zip

Add it using

SetIcons(nIDResourceBitmap, pCommands, nCount);

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andre View Drop Down
Groupie
Groupie


Joined: 09 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote andre Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2005 at 6:29am

Hi Oleg,

I have the latest 9.70.

I admit I did not explain well the "super.ico" example, it is the user that chooses the icon file not me. so I'm not able to insert it in the resource, because I do not know which icon to insert...I have to load it at runtime with LoadImage.

But what I don't understand is that some controls kind of like imagelist while some others don't. Why diferent behaviours ? If one control knows how to display XP icons loaded with LoadImage and then inserted in  ILC_COLOR32 image list, why some others do not ?

In the screenshot I send, you can see that TabControl, DockManager, and TaskPanel display the icon correctly while ToolBar and Shortcut bar don't.

Since I do not have this problem with Alpha bitmaps,

what I really need is something like this...

HICON h;

AlphaBitmap bitmap;

bitmap = ConvertIcon2AlphaBitmap( h );

Is there a function like this in the toolkit ?

 

André

 

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2005 at 8:56am

You must say before, that you load it from file :)

Here some source you can use:

HBITMAP hBitmap = CXTPImageManagerIcon::LoadAlphaIcon(Path, 0);

 if (hBitmap)
 {
  SetIcon(hBitmap, Command, 0, (XTPImageState)imageState);

  DeleteObject(hBitmap);

 } else
 {
  HICON hIcon = (HICON)LoadImage(0, Path,
   IMAGE_ICON, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE);

  if (!hIcon)
   return;

  SetIcon(hIcon, Command, 0, (XTPImageState)imageState);

  DestroyIcon(hIcon);

 }

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andre View Drop Down
Groupie
Groupie


Joined: 09 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote andre Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2005 at 11:09am

Hi Oleg,


Thanks, using LoadAlphaIcon(...) all icons look fine.

Regards

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.