Add two images for the xml ribbon button for large and regular sizes

I have a button on Ribbon XML with a custom image like this

<group id="MyGroup">
<button id="buttonTest" size="large" getImage="GetCustomImage" label="Test"/>
</group>
public Bitmap GetCustomImage(Office.IRibbonControl control)
{
    return Resources.test; // test.png
}

But when the user adds this button in the quick access panel, the button becomes normal. The Office resizing icon may look ugly after that. How to add two images for a button for large (32x32) and regular (16x16) sizes?

+5
source share
1 answer

Is the GetCustomImage method obtained when the button is in the quick access panel? If so, then it should not be too difficult to do what you ask. You just need to know if the button is in the ribbon or QAT

BUT

, , , . 1 1 , .

, , 2 . buttonNormal . , , , . , .

<group id="MyGroup">
    <button id="buttonLarge" size="large" image="largeImage" label="Test" getVisible="GetIsLargeButtonVisible"/>
    <button id="buttonNormal" size="normal" image="normalImage" label="Test" getVisible="GetIsNormalButtonVisible"/>
</group>

GetIsNormalButtonVisible GetIsLargeButtonVisible , .

+1

All Articles