Not able to display my .png files in the ribbon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
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.
Please help.
I am trying to work with the available code found in one of the training sessions,
'Code starts
'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.BeginInit()
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.
Return bi
End Function
Protected Shared Function GetEmbeddedResourceStream(ByVal ResourceName As String) As Stream
Return System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(ResourceName)
End Function
I dont see any error, but the ribbon is getting generated but withut any images, just a plane ribbon.