Graphics

I don't see a way to output graphics. What I'm trying to do is output a randomly selected coat of arms jpg.
Example:

table: coatofarms
This coat of arms for this banner is <image src=[@cot]>;
table: cot
1: symbol1.jpg
2: symbol2.jpg
3: symbol3.jpg
4: symbol4.jpg

The actual images are in the same directory as the ipt file. Obviously the statement the the cot table is called doesn't work. what can I do to make this happen.

Comments

  • Joe M answered this on the mailing list, but I'll add it here for others with this question...

    IPad outputs HTML, and displays its results within an embedded web browser. So you can output html <image> tags from your script. The one trick to keep in mind is that the document root for your table results is the application data directory (something like "C:\Users\<your_name>\AppData\Roaming\nbos\inspiration pad pro"), since thats where the final generated html document containing your table results is stored. So you need to reference the path to the images based on that, or hard code the full path to your image in the image tag, for the embedded web browser to find the image.
  • So the reason I have been getting the little image box with the red X is because my path is wrong, even if my images are in the same directory as the code? However I have hard coded the path (C:\program Files\... ...\nbos in the image tag and still got the same thing.
  • Thanks Ed. That was a crucial bit of information. I now works fine.
  • Still having issues. I either get the red x in a box or text. Here is my code sample:

    castles.ipt
    Use: nbos\CoatOfArms.ipt
    Use: nbos\Noble Household.ipt


    table:Main

    1-4:[@Size][@Condition]. Banners flying over the ramparts have this [@CoatOfArms]Coat Of Arms. <br><b>Occupants:</b> [@Nobles]


    CoatOfArms.ipt

    table CoatOfArms

    <img src="C:\\Program Files\\Role Playing Tools\\enbos\\Inspiration Pad Pro\\InspirationPadPro2\\Common\\data\\Coat Of Arms\\1.jpg”>
    <img src="C:\\Program Files\\Role Playing Tools\\enbos\\Inspiration Pad Pro\\InspirationPadPro2\\Common\\data\\Coat Of Arms\\2.jpg”>
    <img src="C:\\Program Files\\Role Playing Tools\\enbos\\Inspiration Pad Pro\\InspirationPadPro2\\Common\\data\\Coat Of Arms\\3.jpg”>
    <img src="C:\\Program Files\\Role Playing Tools\\enbos\\Inspiration Pad Pro\\InspirationPadPro2\\Common\\data\\Coat Of Arms\\4.jpg”>

    I had to use \\instead of \ and had to rename the nbos directory to enbos for obvious reasons. I have tried a plethora of different ways of getting this to work and the results are always one of the two above. I need help here.
  • To specifiy a local file, use 'file:' in the url for the src, like:
    &lt;img src='file:c:\path\to\file.jpg'&gt;
    

    or perhaps with the double \\'s.

    If you still dont see the image, right click on the box with the red x, and look at it's properties to see what it thinks its trying to load.
  • That's really weird. For some strange reason it doesn't like my path. I dumped my images in the HTML output directory and removed any path and just used the file name and works fine. I just don't want to me storing images in that area.
  • Goodaye,

    'Cause you're probably using Vista and Program files is a protected directory. Best all round to set up IP and all related files outside of c:\Program Files.

    Cheers,
    Plugger

Leave a Comment