.NET

Reply
Valued Contributor
jason.teagle
Posts: 57
Registered: ‎06-22-2010
Message 1 of 2 (135 Views)

Specifying Location Of Images For Ribbon (Relative Path)

135 Views, 1 Replies
04-16-2012 12:42 AM

I'm trying to specify the image source for ribbon images using relative syntax but having no luck.

 

If I use this:

 

button.LargeImage = new BitmapImage(new Uri(@"c:\\folderA\\folderB\\image.png") );

 

it works just fine. But it relies on absolute syntax, which is daft since it forces the code to be installed in a specific directory (or the images).

 

I've tried 

 

button.LargeImage = new BitmapImage(new Uri(@"images\\image.png", UriKind.Relative) );



and

 

button.LargeImage = new BitmapImage(new Uri(@"images/image.png", UriKind.Relative) ); 

 

and I've tried placing the images subdirectory with the png file relative to the assembly, to the project source folder and even relative to AutoCAD itself - and in none of the cases do I get an image.

 

Can anyone shed any light on this for me? I'd like the images subfolder to be relative to the compiled assembly. 

 



Valued Mentor
Posts: 354
Registered: ‎01-27-2010
Message 2 of 2 (129 Views)

Re: Specifying Location Of Images For Ribbon (Relative Path)

04-16-2012 03:38 AM in reply to: jason.teagle

here a sample of my code for create my name of file containing the data of my prog :

 

Dim objAssemblyInfo As ApplicationServices.AssemblyInfo = My.Application.Info

My.Settings.GlobalFichierConfig = objAssemblyInfo.DirectoryPath & "\" & _
objAssemblyInfo.Title + ".cfg"

 with the objAssemblyInfo you retrieve info of your Dll.

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community