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:
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; } }
Comment