Announcement

Collapse
No announcement yet.

push button images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    push button images

    I'm having trouble with push button image sizes on the ribbon. The 32x32 png files get cut off and the 16x16 images look to be up sized and blurry.

    Is there a trick to this? Ive tried different code and doesnt seem to make a difference I'm using the following code:

    Code:
    private void AddPushButton(RibbonPanel panel, string command, string name, string tooltip)
            {
                string path = GetType().Assembly.Location;
    
                string sDirectory
                    = Path.GetDirectoryName(path);
    
                if (string.IsNullOrEmpty(command))
                {
                    command = name;
                }
    
                var pushButton = panel.AddItem(new PushButtonData(name,
            name, ExecutingAssemblyPath, UI.AppName + "." + command)) as PushButton;
    
    
                var Ipath = sDirectory + @"\Images\" + command + ".png";
    
    
                if (command == "CADLink_Architectural")
                {
                    Ipath = sDirectory + @"\Images\" + command + "_None.png";
                }
    
                pushButton.LargeImage =
            new BitmapImage(new Uri(Ipath));
                btn1.LargeImage = btn1.Image;
    
                if (!string.IsNullOrEmpty(tooltip))
                {
                    btn1.ToolTip = tooltip;
                }
                
            }

    #2
    Try another Imaging program. I have this if the PNG comes from GIMP2. To solve, I open the PNG in another programm, and save it again.
    [email protected]

    http://4revit.com

    Comment


      #3
      Wow thanks I was using Fireworks CS5 in MS paint saved as and it fixed it but paint cant make transparent. What did u end up using any suggestions?

      Comment


        #4
        I used GIMP then saved again with mspaint. it should preserve transparency. Didn't find any better workflow yet
        [email protected]

        http://4revit.com

        Comment


          #5
          Originally posted by dalmore View Post
          I used GIMP then saved again with mspaint. it should preserve transparency. Didn't find any better workflow yet
          Thats a pain. I've found gif images work fine and also preserve transparency. I'm exporting from Adobe Fireworks seem to be less work than introducing mspaint. Any issues with using gifs?

          Comment


            #6
            Don't know. Only worked with PNG in Revit yet.
            [email protected]

            http://4revit.com

            Comment

            Related Topics

            Collapse

            Working...
            X