How to make the custom icon tranparent in MFC?
up vote
-1
down vote
favorite
I have a small problem: I built an MFC application using MSVC 14.0 it works fine but somehow I wanted to change the default Icon so I added another icon to "res" folder and Named it as the main icon.
Now after build I get the new icon on my Dialog and in taskbar but it show the background! (white color) I need the background to be Transparent as the IDE does with my default MFC Icon.
After searching I had been suggested to use Image Editor on MSVC but I can't find that toolbar there! I only get the colors when opening the icon to edit in MSVC.
So how could I make the Icon background transparent? I used to use WINAPI where to use BitBlt
but I don't know how here in MFC. Thank you.
- I also see that Toolbar Editor is grayed in Image menu.
mfc transparency
|
show 7 more comments
up vote
-1
down vote
favorite
I have a small problem: I built an MFC application using MSVC 14.0 it works fine but somehow I wanted to change the default Icon so I added another icon to "res" folder and Named it as the main icon.
Now after build I get the new icon on my Dialog and in taskbar but it show the background! (white color) I need the background to be Transparent as the IDE does with my default MFC Icon.
After searching I had been suggested to use Image Editor on MSVC but I can't find that toolbar there! I only get the colors when opening the icon to edit in MSVC.
So how could I make the Icon background transparent? I used to use WINAPI where to use BitBlt
but I don't know how here in MFC. Thank you.
- I also see that Toolbar Editor is grayed in Image menu.
mfc transparency
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
1
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
1
In "Resource View", double click on the icon. Or, in "Solution Explorer" find"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.
– Barmak Shemirani
Nov 22 at 0:32
1
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
1
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36
|
show 7 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a small problem: I built an MFC application using MSVC 14.0 it works fine but somehow I wanted to change the default Icon so I added another icon to "res" folder and Named it as the main icon.
Now after build I get the new icon on my Dialog and in taskbar but it show the background! (white color) I need the background to be Transparent as the IDE does with my default MFC Icon.
After searching I had been suggested to use Image Editor on MSVC but I can't find that toolbar there! I only get the colors when opening the icon to edit in MSVC.
So how could I make the Icon background transparent? I used to use WINAPI where to use BitBlt
but I don't know how here in MFC. Thank you.
- I also see that Toolbar Editor is grayed in Image menu.
mfc transparency
I have a small problem: I built an MFC application using MSVC 14.0 it works fine but somehow I wanted to change the default Icon so I added another icon to "res" folder and Named it as the main icon.
Now after build I get the new icon on my Dialog and in taskbar but it show the background! (white color) I need the background to be Transparent as the IDE does with my default MFC Icon.
After searching I had been suggested to use Image Editor on MSVC but I can't find that toolbar there! I only get the colors when opening the icon to edit in MSVC.
So how could I make the Icon background transparent? I used to use WINAPI where to use BitBlt
but I don't know how here in MFC. Thank you.
- I also see that Toolbar Editor is grayed in Image menu.
mfc transparency
mfc transparency
edited Nov 22 at 0:49
Barmak Shemirani
20.3k42044
20.3k42044
asked Nov 21 at 20:16
Maestro
599
599
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
1
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
1
In "Resource View", double click on the icon. Or, in "Solution Explorer" find"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.
– Barmak Shemirani
Nov 22 at 0:32
1
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
1
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36
|
show 7 more comments
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
1
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
1
In "Resource View", double click on the icon. Or, in "Solution Explorer" find"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.
– Barmak Shemirani
Nov 22 at 0:32
1
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
1
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
1
1
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
1
1
In "Resource View", double click on the icon. Or, in "Solution Explorer" find
"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.– Barmak Shemirani
Nov 22 at 0:32
In "Resource View", double click on the icon. Or, in "Solution Explorer" find
"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.– Barmak Shemirani
Nov 22 at 0:32
1
1
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
1
1
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36
|
show 7 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419854%2fhow-to-make-the-custom-icon-tranparent-in-mfc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
@user4581301: Would you suggest a workaround?
– Maestro
Nov 21 at 20:25
1
Icons are complex. You'll find all the information you will ever need in the references section of this answer.
– IInspectable
Nov 21 at 21:02
1
In "Resource View", double click on the icon. Or, in "Solution Explorer" find
"myapp.rc"
, double click it, and double click the icon. When you see the icon editor, go to main menu, click "Image -> Show color window" It shouldn't be gray unless the icon is read-only, or another program is editing the icon.– Barmak Shemirani
Nov 22 at 0:32
1
I don't know what the problem is. Just create a new icon and draw on it. Post a screen shot of this gray toolbar.
– Barmak Shemirani
Nov 22 at 13:48
1
The icon/image editor in Visual Studio doesn't really support alpha transparency (32bpp), instead it does support 24bpp images, and you can set some portions of the image to be (fully) transparent, or inverse transparent. If this is OK to you fine, otherwise use an external editor. 32bpp images and icons can be included in your resources and compiled without problem; it's just the VS image editor that can't edit them.
– Constantine Georgiou
Nov 23 at 12:36