Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Creating Icons so they look the same in Light or Dark Windows scheme

Anonymous

Creating Icons so they look the same in Light or Dark Windows scheme

Anonymous
No aplicable

Is there a proper way to create a toolbar icon so that it looks the same whether the Window Elements Color scheme is set to Dark or Light?  I can create an icon with certain colors (mostly the background of the icon) and it looks perfect in Light scheme, but if I set my color scheme to Dark, it looks crappy.

All the Autocad icons look correct no matter whether you're in dark or light.

 

I attached screen shots of icons in both Windows Element Color Scheme settings.

 

I must have to build the icon bmp a certain way?

Thanks.

0 Me gusta
Responder
Soluciones aceptadas (1)
1.809 Vistas
12 Respuestas
Respuestas (12)

JTBWorld
Advisor
Advisor
Use the PNG format and add transparency where needed.

Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Me gusta

Anonymous
No aplicable

I haven't heard about way.  Can you give me some direction, or point me to literature on how to do that?  Thank-you

0 Me gusta

JTBWorld
Advisor
Advisor
Solución aceptada
Download a free image editor like Paint.NET to add transparency and save to PNG. There might be tutorials if you search for it.

Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

0 Me gusta

Anonymous
No aplicable

Thanks for the help!  I will do that.

0 Me gusta

stefanome
Collaborator
Collaborator

I disagree, the background has nothing to do with the question.

The image attached to the original post shows two bitmaps with different colors. In one the arrow is black in the other is gray.

Those are two different bitmaps, they are not the same bitmap that looks good in both light and dark theme.

 

The correct answer is to create two sets of bitmaps (I'm pretty sure about this), then (I'm less sure about this) to use COLORTHEME to decide whether to load the light or the dark one. Using COLORTHEME would work when the icons are loaded, but wouldn't help if the user changes theme during the session. I don't know if there is an event triggered when the value of COLORTHEME changes.

0 Me gusta

alexKoshman
Collaborator
Collaborator

Dear stefanomenci! You are absolutely right!

We have to make different Icons for Dark and Light Themes, and allow AutoCAD to automatically change them on Toolbars and Ribbons (but not in PopUp Menus still using Light Theme only) when user changes the color Theme.

To achieve this we have to use ICO's but not PNG's (or even more old bad BMP's) and put them to DLL with our "MenuName" as a feile names: "MenuName.dll" for Dark Theme and "MenuName_light.dll" for Light Theme. Also we can use 16x16 and 32x32 icons for small and big Toolbar buttons if you can imagine youself using these very big buttons! ; ))

AutoCAD will change icons according to current Theme.

 

It seems to me we can't use individual PNG or BMP (or even ICO) files and force AutoCAD change icons from Theme to Theme.

0 Me gusta

stefanome
Collaborator
Collaborator

Hi @alexKoshman, thanks for the reply.


@alexKoshman wrote:

To achieve this we have to use ICO's but not PNG's (or even more old bad BMP's) and put them to DLL with our "MenuName" as a feile names: "MenuName.dll" for Dark Theme and "MenuName_light.dll" for Light Theme


Are you saying that AutoCAD automatically switches dll as soon as the value of COLORTHEME changes, simply by adding the "_light" suffix to the dll name?

 

Or are you describing your way to store the images on your add-in, and you decide which dll to use when the add-in is first loaded on each session?

0 Me gusta

cadffm
Consultant
Consultant

AutoCAD searchs for it, that's how it works. Nothing to do with 3rd application.

Sebastian

0 Me gusta

stefanome
Collaborator
Collaborator
Is this feature documented?
If not, can you show an example?
0 Me gusta

cadffm
Consultant
Consultant

>>"Is this feature documented?

Yes

https://help.autodesk.com/view/ACD/2021/ENU/?guid=GUID-9AA3EEC1-031C-4E88-A966-4CBC07AD112C

 

>>"If not, can you show an example?"

If or if not, why not create your own?

 

Create a Sample1.cuix with a button which refer to the Icon "Test"

 

Create Sample1.dll with one Icon "Test"

Create another dll Sample1_light.dll,

also with another Icon "Test"

Put all three files in a folder and test it.

Dark will show the one and light will show the other Icon.

 

If it isn't working, we will help you to find your issue (wrong image name in cuix, old mnr files, whatever)

 

Sebastian

0 Me gusta

alexKoshman
Collaborator
Collaborator

Oh! I do can show it for you!
In AutoCAD  Help  documentation!  : )))

Like this: https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/The-to...

And that: https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Au...

CADffm! I'm sure you can find that right in your AutoCAD Help by typing "About Managing and Sharing Custom Images"! ; ))

 

And on this forum: https://forums.autodesk.com/t5/objectarx/how-to-support-autocad-2015-dark-amp-light-themes-for-ribbo...

cadffm
Consultant
Consultant

>>"In AutoCAD Help documentation!"

 

Both target pages are not part of the Product documentation, but also a good source.

Kudos for you.

Sebastian

0 Me gusta