How can I control the icons' size of the items in a toolPalette or buttonPalette?

677
4
Jump to solution
12-11-2018 04:16 AM
MarioD_Amico
New Contributor II

I have build two toolPalette and I have added them to two different groups looking to the DAML file they have same attributes:

<group id="ImportTools" caption="Import tools" appearsOnAddInTab="false" condition="ImportSources_condition" keytip="IT">
<toolPalette refID="ImportSources_ToolPalette" size="large" />
</group>

<group id="IntersectionsManager" caption="Intersections Manager" appearsOnAddInTab="false" condition="EditableMapViewActive_condition" keytip="IM">
<toolPalette refID="IntersectionsManager_ToolPalette" size="large" />
<button refID="IntersectionManagerApply_btn" size="large" />
<button refID="IntersectionManagerCancel_btn" size="large" />
</group>

<toolPalette id="ImportSources_ToolPalette" showItemCaption="true" itemsInRow="1">
<tool refID="ImportSources_ByRectangle_tool" />
<tool refID="ImportSources_ByCircle_tool" />
<tool refID="ImportSources_ByPolygon_tool" />
<tool refID="ImportSelectedSources_btn" />
</toolPalette>

<toolPalette id="IntersectionsManager_ToolPalette" showItemCaption="true" itemsInRow="1">
<tool refID="IntersectionsManager_ByRectangle_tool" />
<tool refID="IntersectionsManager_ByCircle_tool" />
<tool refID="IntersectionsManager_ByPolygon_tool" />
<tool refID="IntersectionsManager_Selection_btn" />
</toolPalette>

All the referenced tools have set largeImage and smallImage properties and the image files are marked as "AddInContent" in the project.

During the execution the items in the IntersectionsManager_ToolPalette are drawn using the largeImage 32x32 and they are rendered at the correct size, the items in the ImportSources_ToolPalette are drawn using the largeImage  32x32 but they are rendered small (16x16), shifted to the left and half icon is missing.

Any suggestion?

0 Kudos
1 Solution

Accepted Solutions
MarioD_Amico
New Contributor II

Finally, I have found the trick. It was caused by the image itself.

I have to save the image as PNG without Exif information and 8bpc RGBA

View solution in original post

4 Replies
GKmieliauskas
Esri Regular Contributor

Hi Mario.

Your buttons have size attribute which is "large". I add the same attribute to your tools:

<toolPalette id="ImportSources_ToolPalette" showItemCaption="true" itemsInRow="1">
<tool refID="ImportSources_ByRectangle_tool"  size="large"/>
<tool refID="ImportSources_ByCircle_tool"  size="large"/>
<tool refID="ImportSources_ByPolygon_tool"  size="large"/>
<tool refID="ImportSelectedSources_btn"  size="large"/>
</toolPalette>

0 Kudos
MarioD_Amico
New Contributor II

Hi Gintautas.

Thank you for your answer, I have tried but it's not working, moreover size is not a valid attribute for the tool items inside the toolPalette as you can see from the documentation:

CT_ToolPalette Complex Type 

CT_MenuButtonRef Complex Type 

0 Kudos
GKmieliauskas
Esri Regular Contributor

I use tools inside group and size attribute works. Another way is to put tools to buttonPalette and buttonPallete has attribute size. It works in my project too.

0 Kudos
MarioD_Amico
New Contributor II

Finally, I have found the trick. It was caused by the image itself.

I have to save the image as PNG without Exif information and 8bpc RGBA