NWatermark NImageFillStyle


Author
Message
Mike O'Ceirin
Mike O'Ceirin
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 22, Visits: 184
Using your documentation I do have this working but there is a problem. It is working on my desktop in a visual studio web form. I cannot get away from giving it an absolute reference to the graphics *.gif file. In the default.aspx page there can be a relative reference to "~/WaterMark.gif" but trying to apply the same file to Fillstyle I am forced to use "E:\\Development\\Production\\Energy Chart\\Energy Chart\\WaterMark.gif". When I publish this to the web it produces a black rectangle? It certainly looks all wrong. Essentially the control will not recognise the gif file that is part of the solution.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

 Hi Mike,
You can try to convert the relative path to an absolute one using MapPathSecure:

this.MapPathSecure(this.TemplateSourceDirectory + "\\" + "someImage.gif");

for example, will give you the absolute path to "someImage.gif" located in the same directory as the current aspx page.

We hope this helps - let us know if you have any questions or meet any problems.



Best Regards,
Nevron Support Team


Mike O'Ceirin
Mike O'Ceirin
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 22, Visits: 184
It works as per documentation and is an absolute path on my desktop. The image must be added to the solution and then published to the web. To do this you must have a relative path so your answer is back to front. The question is why wont this the watermark accept a relative path. I do not see how it can be used if it will not.
Mike O'Ceirin
Mike O'Ceirin
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 22, Visits: 184
My previous comment was a bit premature I didn't see what you were driving at. So the answer is take the relative and use this

string imagePath =
      MapPathSecure(this.AppRelativeTemplateSourceDirectory + "\\" + "WaterMark.gif");
to find the absolute. Note it is AppRelativeTemplateSourceDirectory not AppTemplateSourceDirectory.

Thanks for your help.

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Mike,

We're glad you managed to fix the problem. Yes, that was the original idea - to convert the path to a relative while the code is still on the aspx page. The chart itself will not try to convert paths from relative to absolute as the engine has to work on desktop as well so it does not have information on how to remap the path properly. Let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search