MFC using xaml for HICON |
Post Reply |
Author | |
Duane
Groupie Joined: 16 May 2023 Location: Montreal Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 19 May 2023 at 11:34am |
How can I create an HICON from an XAML resource? I've tried HICON hIcon = (HICON)::LoadImage(theApp.m_hInstance, MAKEINTRESOURCE(IDR_LOGO), IMAGE_ICON, szIcon.cx, szIcon.cy, LR_SHARED); But hIcon here is NULL. Is this possible? I am able to add that resource to an image vector and use it for a ribbon without problem.
|
|
astoyan
Admin Group Joined: 24 August 2013 Status: Offline Points: 302 |
Post Options
Thanks(0)
|
Hello Duane,
It is possible to make an HICON from XAML by rendering XAML into a bitmap and then making an icon from that bitmap manually. But that is not only a tedious work, but also a useless and pointless one as the whole point of having XAML icons is to ensure that you need only one XAML image to handle or possible icon sizes and to ensure a crisp and scalable image. Look for SetVectorIcon calls in ToolkitPro samples, like RibbonSample and similar. Regards, Alexander
|
|
Duane
Groupie Joined: 16 May 2023 Location: Montreal Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Thanks for the reply. I guess my question was poorly worded. I am not specifically looking to convert an XAML into an HICON. I want to be able to use the XAML as the frame icon. I am able to use SetVectorIcon for the ribbon without problem. But the frame icon in the sample is using CXTPFramePaintManager. And this doesn't have a SetVectorIcon member.
|
|
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 |