none
Creating ribbon images RRS feed

  • Question

  • Hi

    i was involved in creating images for a ribbon button in word addin

    and when i assign the BMP image created to the control.I could see the background is getting displayed.How to avoid this? i would like display only the image .

    For ex: the icon displayed in the office controls.

    Please share me some samples.

    Sunday, September 8, 2013 11:51 AM

Answers

  • Hi Parthasarathy,

    According to your description, you want to display the icon in a control of ribbon.

    However, .bmp image does not support transparency; To achieve your goal, I suggest you converting your image to PNG or GIF format and define background as transparent.

    Here is my code for your reference.

    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {
            button2.Image = System.Drawing.Image.FromFile(@"C:\A.png");
            button2.ShowImage = true;
        }
    }
    


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 9, 2013 9:05 AM
    Moderator