SpiceLogic Inc.
                                                                                                     SpiceLogic Inc. Home PageProductsJournalMy AccountHelp DeskContact Us
 
Knowledge base  : .NET Win HTML Editor Control    - Standard Edition
Welcome Guest   Login

Skip Navigation Links. .NET Win HTML Editor Control

Documentation  Documentation

Download   Download the latest version

Back to the home of knowledgebase forum Relative path picture and BaseUrl

An user   9/16/2009 4:32:13 AM

Hi

 

When embedding a picture the control uses the absolute path to the picture. E.g. C:\.....\.....\...\*.bmp

 

Since the location of the pictures during development will not be the location of the pictures once the customer has installed the software on their computer.

 

Is it possible to set the picture to the default location of the installed software. I have tried editing the path the picture, however, all I get is the picture not found icon.

 

Many thanks

 Andy




Resolution:
- [SpiceLogic Support Technician]   9/20/2009 3:19:15 AM

Dear Andrew,
I think you can easily do that. In your Form's Load event, set the BaseUrl property of this control to Application.StartupPath + "\Pictures"; I think it will work.



An user   9/22/2009 6:26:29 PM

I have tied setting the BaseUrl property of the control to Application.StartupPath + "\Pictures".
 
However, the control still looks for the picture in the origional folder path. Any other suggestions would help.
 
Andy



An user   9/26/2009 3:33:45 AM

Hi Nathan
 
I still have not managed to get
 
I have placed the code htmlInfo.BaseUrl = Application.StartupPath & "\Pictures" into the formload event, however, this dose not seem to work if i install the exe in a different folder. This is how I test it.
 
Say I insert a picture C:\Picures\xxx.bmp. Then save the HTML code for this.
 
I then create a folder C:\Test\Picures and copy the image xxx.bmp to this folder.
 
I then place my exe file in the C:\Test folder.
 
Finaly I delete the origional image file form C:\Picures\xxx.bmp to make sure the control dose not read the image from this folder.
 
When I run the programme form C:\Test the image dose not load.
 
Please could you help.
 
Thanks
 
Andy  



- [SpiceLogic Support Technician]   9/30/2009 11:54:42 PM

Dear Andrew,

We appreciate your patience bearing with us.

Well, what you need to do is to set the Base URL path as before. Then when you want to insert an image use the following steps,

On the toolbar select the Image button.

1. In the Image insert dialog box select relative to base URL Radio button.

2. If the base URL location is valid then you will see two options.

3. If the image is already in the Base URL folder please use the option "Browse for a file". It will start in the base folder and let you choose the image"

4. Or if the image is not in the base folder please select the option "Import a file to the base folder"

Then you are done.

I have attached a zip file with some screen-shots. Please follow according to the sequence.

Moreover you can also add buttons or other related controls to let the user choose the base URL himself/herself. Just in the buttons handling event you change the BaseUrl Property to the user's chosen path.

Thank You.




An user   10/1/2009 3:00:13 AM

Thanks Tanzirul

 

Ok I now understand how this works. This is not quite what I was looking for but I can work around this.

 

I will try to explain how I am using the control and what I was looking for.

 

I have a programme which I distribute (say HTML.exe) which displays a series of HTML documents using your control. This is set to enabled = false so the user can not change the documents.

 

During development I use the HTML control to create the documents.

 

Now this is OK if the user always installs the programme (HTML.exe) where the baseurl is set to. However, if they install it in a different folder then the control will not find the pictures.

 

What I was looking for was a way for the control to always look in the default folder where the exe is installed.

 

Anyway, as I said no problem I will work around this.

 

Thanks for your help.

 

Andy

 




Resolution:
- [SpiceLogic Support Technician]   10/1/2009 3:20:12 AM

Dear Andrew,
 
The solution is very easy. In your case, you always set the BaseUrl programmatically in your Form's Load event so that your HTML.exe can be installed anywhere but the baseurl folder can be mapped from your Form's Load event according to your logic. And you need to make sure that, the image urls in your html document are RELATIVE URLs. for example, if your image tag is something like, <img src="mypicture.jpg" /> and if you set your Base Url programmatically in your Form's Load event and if your programmatically mapped BaseUrl folder contains the image, then there is no reason why you should not see the pictures.
 
Anyway, please do not hesitate to write us back if you need any more assistance.



Home  || Products  || Journal  || My Account  || HelpDesk  || Contact Us

Website and Software Copyright ©2010, SpiceLogic Inc., All Rights Reserved.