Good day, Merry Christmas and a Happy new year to all,
I am trying to create a ribbon of my own, and the code and execution is fine, but I am not able to put the images.
my images are not more than 1 kb in size and are stored in the resources.resources1.... how do I get them to display.
I am trying to work with the available code found in one of the training sessions,
'on one of my subs I am calling this function
'ribBtn.LargeImage = LoadImage("FR.png")
Private Shared Function LoadImage(ByRef ImageName As String) As Imaging.BitmapImage
Dim bi As New System.Windows.Media.Imaging.BitmapImage()
bi.StreamSource = GetEmbeddedResourceStream("MyRibbon_Autocad." & ImageName)
bi.EndInit() ' When i debug the code, the code is exiting at this point, i am assuming it is not getting initialised.
Protected Shared Function GetEmbeddedResourceStream(ByVal ResourceName As String) As Stream
I dont see any error, but the ribbon is getting generated but withut any images, just a plane ribbon.
Wish you a very happy new year.
Have you set the "ribBtn.Size = RibbonItemSize.Large" ?
This will ensure that AutoCAD uses the large image.
Here is a blog post with a sample code that might help :
Thank you and to you
using System.Windows.Media.Imaging; using Autodesk.Windows; . . . RibbonButton rConductorbutton = new RibbonButton(); rConductorbutton.Text = "OOO"; rConductorbutton.Id = "btnConductor"; rConductorbutton.Orientation = System.Windows.Controls.Orientation.Vertical; rConductorbutton.Size = RibbonItemSize.Standard; rConductorbutton.Image = new BitmapImage(new Uri(... + @"\Icon\Conductor32.png", UriKind.RelativeOrAbsolute)); rConductorbutton.ShowText = true; rConductorbutton.ShowImage = true; rConductorbutton.Click += new System.Windows.RoutedEventHandler(btnCounductor_Cl
it can be one of the ways that you can use to show png file but it's C# if couldn't change it to VB let me know to change it for you
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!