cmenu

How to show menu bitmaps with transparent background

随声附和 提交于 2021-02-08 03:10:55
问题 I am using this code: m_bmpSwap.LoadBitmap(IDB_BITMAP2); pMnuPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &m_bmpSwap, &m_bmpSwap); It looks like: It was only a test image: How exactly do I get my image to look as if it has a transparent background? It is 24 bit image. I have seen this but I can't work it out. I adjusted to a 8 bit image with 192/192/192 as the background and loaded like this: HBITMAP hBmp; hBmp = (HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE

How to show menu bitmaps with transparent background

China☆狼群 提交于 2021-02-08 03:01:23
问题 I am using this code: m_bmpSwap.LoadBitmap(IDB_BITMAP2); pMnuPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &m_bmpSwap, &m_bmpSwap); It looks like: It was only a test image: How exactly do I get my image to look as if it has a transparent background? It is 24 bit image. I have seen this but I can't work it out. I adjusted to a 8 bit image with 192/192/192 as the background and loaded like this: HBITMAP hBmp; hBmp = (HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE

How to show menu bitmaps with transparent background

依然范特西╮ 提交于 2021-02-08 03:01:22
问题 I am using this code: m_bmpSwap.LoadBitmap(IDB_BITMAP2); pMnuPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &m_bmpSwap, &m_bmpSwap); It looks like: It was only a test image: How exactly do I get my image to look as if it has a transparent background? It is 24 bit image. I have seen this but I can't work it out. I adjusted to a 8 bit image with 192/192/192 as the background and loaded like this: HBITMAP hBmp; hBmp = (HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE

How to show menu bitmaps with transparent background

假装没事ソ 提交于 2021-02-08 03:00:47
问题 I am using this code: m_bmpSwap.LoadBitmap(IDB_BITMAP2); pMnuPopup->SetMenuItemBitmaps(0, MF_BYPOSITION, &m_bmpSwap, &m_bmpSwap); It looks like: It was only a test image: How exactly do I get my image to look as if it has a transparent background? It is 24 bit image. I have seen this but I can't work it out. I adjusted to a 8 bit image with 192/192/192 as the background and loaded like this: HBITMAP hBmp; hBmp = (HBITMAP)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP2), IMAGE

How to add submenu to a CMenu in MFC?

会有一股神秘感。 提交于 2021-02-07 10:30:41
问题 I have an MFC app that uses CMenu for the main menu bar. I haven't been able to create submenus successfully. I can have the first level of File, Edit, View, etc and their sub menus, but I can't create a submenu off of one of those menus. For example, I would like to be able to go File->Recent Items-> list of items in submenu I can do this easily enough with the resource editor in VS, but this needs to be done dynamically. Am I using the right class in CMenu? Any suggestions on what to try? I

Simple way to show a bitmap next to a menu item in a CMenu with correct transparency

妖精的绣舞 提交于 2021-01-28 05:19:07
问题 First off, I'm not a C++ developer, I program mainly in C#. I am trying to use the ContextMenu (yes I'm aware of ContextMenuStrip) class in .NET which is a wrapper around CMenu in my application. How do I display an image next to a menu item that has proper transparency? What I've done so far is call SetMenuItemBitmaps on my menu item, here is the attached result: As you can see there is a white background on the menu item. This is just so frustratingly close to what I want. How can I get the

MFC CMenu tooltip not being displayed

孤者浪人 提交于 2020-01-14 07:11:06
问题 I tried using something like this to set the tool tip of a CMenu item (as described here) but it is just being displayed in a single line and the line break is not visible. // read control id UINT id = menu->GetMenuItemID(1235); // modify caption and add tooltip? menu->ModifyMenu( id, MF_BYCOMMAND, id, "Click here\nThis is the tooltip for the menu item ..."); I also tried to set the caption directly in the visual studio resource designer of the menu item with the same effect. Can you give me

MFC : How to add tooltip in Cmenu items?

浪子不回头ぞ 提交于 2019-12-01 17:51:53
How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks... The easiest way is to pass multiple strings to the Menu text separated by newline characters. This will automagically make CMenu display the second part of the text as the menu tooltip. e.g., If a menu item text is "Click here", change it to "Click here\nThis is the tooltip for the menu item ..." Of course, if you like more advanced/fancy tooltips, then try http://www.tooltips.net/downloads.html Its easy to implement, and the output is very cool Tooltips for Menu Item and

MFC : How to add tooltip in Cmenu items?

本小妞迷上赌 提交于 2019-12-01 17:09:03
问题 How do you add tooltips for CMenu Items? I couldn't find any straightforward and helpful resource. Please help. Thanks... 回答1: The easiest way is to pass multiple strings to the Menu text separated by newline characters. This will automagically make CMenu display the second part of the text as the menu tooltip. e.g., If a menu item text is "Click here", change it to "Click here\nThis is the tooltip for the menu item ..." Of course, if you like more advanced/fancy tooltips, then try http://www