How can I get my own icon to a button on a ribbon? Do I need a icon resource?
The Ribbon is load to Microstation Connect Edition and works fine. I use a xml file for the ribbon. Here is a snippet of a button in the xml file.
<Button Name="MSCEAddin.OpenAction" Priority="100"> <Label>Open</Label> <Description>Open document.</Description> <ButtonParams CollapseToSmall="WhenGroupIsSmall" Size="Large"> </ButtonParams> <ButtonData> <CommandData Type="UserKeyinCommand"> <UserKeyinCommand> <Keyin>MSCEAddin Open</Keyin> <Icon Type="NamedIcon"> <NamedIcon>Application</NamedIcon> </Icon> </UserKeyinCommand> </CommandData> </ButtonData> </Button>
I think, the issue is the NamedIcon <NamedIcon>Application</NamedIcon>. How can I get 'MyOwnIcon.png' as icon?
Hi Philip,
there are more way how and where to store own icons, that are used in ribbon. As Jon wrote, the standard format is .ico, not png, so you have to convert your icons at first.
I think there are (at least) three ways:
The most simple is to use ico files:
I guess the best, because it does not require any compilation, but using one file as a storage, is to store icons in dgnlib:
Result (worm defined in dgnlib, brain slug in separate ico file):
With regards,
Jan
P.S. Please always use Insert > Insert code too to share code snippets. It's annoying to read code or xml content formated as a plain text.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:worm defined in dgnlib, brain slug in separate ico file
Please tell us more about those tools.
Regards, Jon Summers LA Solutions
Jon Summers said:Please tell us more about those tools.
Not too much behind these icons... ;-)
They are leftovers of an evaluation of ribbon configurations I did in the past and the tools only call MicroStation key-ins:
<Button Name="Drawing.MyTab.MyButton" Priority="100"> <Label>Place worm</Label> <Description>Place linear element</Description> <ButtonParams Size="Large" /> <ButtonData> <CommandData Type="UserKeyinCommand"> <UserKeyinCommand> <Keyin>place smartline</Keyin> <Icon Type="NamedIcon"> <NamedIcon>my_icon_worm</NamedIcon> </Icon> </UserKeyinCommand> </CommandData> </ButtonData> </Button> <Button Name="Drawing.MyTab.NButton" Priority="100"> <Label>Place brain slug</Label> <Description>Place cell element</Description> <ButtonParams Size="Large" /> <ButtonData> <CommandData Type="UserKeyinCommand"> <UserKeyinCommand> <Keyin>place cell icon;set item toolsettings activecell=alien</Keyin> <Icon Type="NamedIcon"> <NamedIcon>my_icon_brain-slug</NamedIcon> </Icon> </UserKeyinCommand> </CommandData> </ButtonData> </Button>
Regards,
Hi
I have not done this before so was wondering if anyone has suggestions for free tools to convert to .ico format?
helgeh said:tools to convert to .ico
Search the Web for plenty of answers to your question. You can even convert files on-line!
Thanks Jon!