PDA

View Full Version : embed image



flekhabren
July 10th, 2017, 19:22
I'm continuing to develop this custom library module and am wondering if there is an instance of an image type that I could use. I want to include common maps of the world in the game manual. I'm starting my digging but I thought I'd check here in case someone knew or could find it before I do.

Trenloe
July 10th, 2017, 19:30
You can only embed images within a library Reference Manual. Info here: http://www.fantasygrounds.com/wiki/index.php/Reference_Manuals

flekhabren
July 10th, 2017, 20:56
So if I add this line in the a reference section it would insert the picture at that location? (<reference><BRPother><Country><index><entry-000>)

<image type="image"><bitmap>\maps\country00.bmp</bitmap></image>

Trenloe
July 10th, 2017, 21:02
Oh, sorry. I didn't actually see this was in the BRP ruleset sub-forum.

You can't embed images. All you can do is clickable links to images.

Zacchaeus
July 10th, 2017, 21:05
You need a bit more than that. And you should use .jpg files
<align type="string">center</align>
<size type="string">x,y</size>
<image type="image">
<bitmap type="string">images\imagename.jpg</bitmap>
</image>
<caption type="string" />
<blocktype type="string">image</blocktype>

flekhabren
July 10th, 2017, 21:06
ah foiled again :)

so could I do something like this?

<link class="referenceimage" recordname="\maps\country00.png">Map of country X</link>

flekhabren
July 10th, 2017, 21:07
You need a bit more than that. And you should use .jpg files
<align type="string">center</align>
<size type="string">x,y</size>
<image type="image">
<bitmap type="string">images\imagename.jpg</bitmap>
</image>
<caption type="string" />
<blocktype type="string">image</blocktype>

sorry, missed this one before replying. I'll see if I can give that a try?

Trenloe
July 10th, 2017, 21:15
sorry, missed this one before replying. I'll see if I can give that a try?
Nope, won't work in BRP. Sorry.



so could I do something like this?

<link class="referenceimage" recordname="\maps\country00.png">Map of country X</link>
Not quite. You can't directly reference image files in a link. They need to be in the database <image> node and reference the image.id-00001 record (for example).

Drag an image link to a story entry in a campaign and then look at the campaign db.xml to get the XML needed for the link.

flekhabren
July 10th, 2017, 21:18
Thanks. I'll give that a whirl and see if I can follow through it.

flekhabren
July 11th, 2017, 15:32
I was able to follow the steps above and got this line of xml

<link class="imagewindow" recordname="image.id-00006">Country</link>

I'm guessing that I need to repeat this process with each image I want to use? Is there somewhere that image.id-00006 is defined as a file name/location?

Will it mess up the process if the images are stored in the campain folder/file?

Trenloe
July 11th, 2017, 15:43
I'm guessing that I need to repeat this process with each image I want to use? Is there somewhere that image.id-00006 is defined as a file name/location?
Yep, you'll have to do it for each image.

The image reference will need to be stored in the module XML (not the campaign, otherwise your module will be tied to one campaign only). From your story/image link test above, export Story and Images into a module and see how the XML stores the image data and how the link references the module name using the @ sign.

flekhabren
July 11th, 2017, 17:24
Yep, you'll have to do it for each image.

The image reference will need to be stored in the module XML (not the campaign, otherwise your module will be tied to one campaign only). From your story/image link test above, export Story and Images into a module and see how the XML stores the image data and how the link references the module name using the @ sign.

I haven't done an export before. Is there steps for this somewhere?

Trenloe
July 11th, 2017, 17:26
http://www.fantasygrounds.com/wiki/index.php/Library#Module_Export

flekhabren
July 11th, 2017, 17:26
great, thanks

flekhabren
July 13th, 2017, 15:52
perhaps I'm missing it. How do I complete the export?

19782

Trenloe
July 13th, 2017, 19:39
Fantasy Grounds Golden rule #1 - right-click for context sensitive menus.

http://www.fantasygrounds.com/wiki/index.php/The_Basics#Context_Menus

flekhabren
July 13th, 2017, 19:41
Fantasy Grounds Golden rule #1 - right-click for context sensitive menus.

http://www.fantasygrounds.com/wiki/index.php/The_Basics#Context_Menus

sorry, I should have though about that, thanks

flekhabren
July 13th, 2017, 20:57
ok, the export created a db.xml. Within that there was a section <image> with a link between the image and the id number. It looks like it just put the images in the root of the module. So if I add the code of the <link> to the <reference> entrys and also add the <image> section to my common.xml, maybe between the <library> and <reference> sections should get it to work right?

Oh and copy the images to my existing module root.

Trenloe
July 13th, 2017, 21:00
ok, the export created a db.xml. Within that there was a section <image> with a link between the image and the id number. It looks like it just put the images in the root of the module. So if I add the code of the <link> to the <reference> entrys and also add the <image> section to my common.xml, maybe between the <library> and <reference> sections should get it to work right?

Oh and copy the images to my existing module root.
Sounds about right.