WINVER=0x500 yields jagged icon in CXTPTaskDialog |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 28 May 2009 at 10:21am |
I have a custom icon in my CXTPTaskDialog (not using Vista API). When I set WINVER=0x0500 the icon is drawn a la Windows 2000. The borders become jagged (i.e. no alpha blending). Note that I have included the needed manifest!
I believe your dialog uses the native icon drawing functions. This causes a problem in the above scenario.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
The icon is loaded via this call: LoadImage (NULL, pFileName, IMAGE_ICON, cxIcon, cyIcon, flags); Hmm, is this the root cause? |
|
PokerMemento - http://www.pokermemento.com/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, We have standard DrawIconEx API call to draw it. so problem can be only in icon or way you load it. Try add LR_CREATEDIBSECTION flag.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
This is really strange. I don't think this has to do with CJ.
If I load ico-files with this API, and then put them in your toolbars, the alpha layer seems to be lost!
This worked a couple of months ago. Since then I've upgraded from 12.1.1 to 13.0.0. Perhaps MS updated a vital DLL somewhere? Don't get it...
Could you please try this?
HICON hIcon = NULL;
UINT iconID = 0; if (PrivateExtractIcons("C:\\WINDOWS\\notepad.exe", 0, 16, 16, &hIcon, &iconID, 1, LR_COLOR)) { iconID = XTPImageManager()->AddCustomIcon(hIcon); pButton->SetIconId(iconID); DestroyIcon(hIcon); } The resulting image is screwed at the borders...
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
It's just like ComCtl32.dll v5.8 was being used... I don't get it! My code worked a couple of months ago... Clearly, the manifest is not included in your dll. Just made a search for the public key token: 6595b64144ccf1df Not found? |
|
PokerMemento - http://www.pokermemento.com/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
It have to be included to your exe - not to our dll.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Just tried with CustomThemes sample
HICON hIcon = NULL;
UINT iconID = 0; if (ExtractIconEx("C:\\WINDOWS\\notepad.exe", 0, 0,&hIcon, 1)) { XTPImageManager()->SetIcon(hIcon, ID_FILE_OPEN); DestroyIcon(hIcon); } Works well.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Ok, but in my application the error is so obvious:
I load the icon and put it in my ribbon, and it looks great! Then, I use the same HICON in a CXTPTaskDialog and it gets an ugly border.
Either it has been scaled, or it is drawn incorrectly!
32x32 pixels...
This is a fact.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Sorry for bothering you :P. It turned out my stupid icon was loaded as 48x48, which caused a resize...
Argh!
Anyway, thanks for your assistance!
|
|
PokerMemento - http://www.pokermemento.com/
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |