<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxImageBundle"></a>mxImageBundle</h1><divclass=CBody><p>Maps from keys to base64 encoded images or file locations. All values must be URLs or use the format data:image/format followed by a comma and the base64 encoded image data, eg. “data:image/gif,XYZ”, where XYZ is the base64 encoded image data.</p><blockquote><preclass="prettyprint">$bundle = new mxImageBundle();
The image can then be referenced in any cell style using image=myImage.
To convert an image at a given URL to a base64 encoded String, the following
code can be used:
(code)
echo "base64=".base64_encode(file_get_contents($url));</pre></blockquote><p>The value is decoded in <ahref="mxUtils-php.html#mxUtils.loadImage"class=LFunctionid=link7onMouseOver="ShowTip(event, 'tt6', 'link7')"onMouseOut="HideTip('tt6')">mxUtils.loadImage</a>. The keys for images are resolved and the short format above is converted to a data URI in <ahref="../view/mxGraph-php.html#mxGraph.postProcessCellStyle"class=LFunctionid=link8onMouseOver="ShowTip(event, 'tt7', 'link8')"onMouseOut="HideTip('tt7')">mxGraph.postProcessCellStyle</a>.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxImageBundle">mxImageBundle</a></td><tdclass=SDescription>Maps from keys to base64 encoded images or file locations. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxImageBundle.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxImageBundle.images"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">images</a></td><tdclass=SDescription>Maps from keys to images.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxImageBundle.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxImageBundle.mxImageBundle"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">mxImageBundle</a></td><tdclass=SDescription>Constructs a new image bundle.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxImageBundle.getImages"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">getImages</a></td><tdclass=SDescription>Returns the <ahref="#mxImageBundle.images"class=LVariableid=link4onMouseOver="ShowTip(event, 'tt1', 'link4')"onMouseOut="HideTip('tt1')">images</a>.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxImageBundle.putImage"id=link5onMouseOver="ShowTip(event, 'tt4', 'link5')"onMouseOut="HideTip('tt4')">putImage</a></td><tdclass=SDescription>Adds the specified entry to the map.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxImageBundle.getImage"id=link6onMouseOver="ShowTip(event, 'tt5', 'link6')"onMouseOut="HideTip('tt5')">getImage</a></td><tdclass=SDescription>Returns the value for the given key.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxImageBundle.images"></a>images</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $images</td></tr></table></blockquote><p>Maps from keys to images.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxImageBundle.mxImageBundle"></a>mxImageBundle</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>function mxImageBundle()</td></tr></table></blockquote><p>Constructs a new image bundle.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxImageBundle.getImages"></a>getImages</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>function getImages()</td></tr></table></blockquote><p>Returns the <ahref="#mxImageBundle.images"class=LVariableid=link9onMouseOver="ShowTip(event, 'tt1', 'link9')"onMouseOut="HideTip('tt1')">images</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxImageBundle.putImage"></a>putImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function putImage(</td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the specified entry to the map.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxImageBundle.getImage"></a>getImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getImage(</td><tdclass=PParameternowrap>$key</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the value for the given key.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $images</td></tr></table></blockquote>Maps from keys to images.</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>function mxImageBundle()</td></tr></table></blockquote>Constructs a new image bundle.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>function getImages()</td></tr></table></blockquote>Returns the images.</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function putImage(</td><tdclass=PParameternowrap>$key,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds the specified entry to the map.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getImage(</td><tdclass=PParameternowrap>$key</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the value for the given key.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function loadImage(</td><tdclass=PParameternowrap>$url</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Loads an image from the local filesystem, a data URI or any other URL.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function postProcessCellStyle(</td><tdclass=PParameternowrap>$style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.</div></div><!--END_ND_TOOLTIPS-->