<ahref="classcom_1_1mxgraph_1_1mxImageBundle-members.html">List of all members</a></div>
<divclass="headertitle">
<divclass="title">com.mxgraph.mxImageBundle Class Reference</div></div>
</div><!--header-->
<divclass="contents">
<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.
<trclass="memdesc:ac08a8c7641c7c68aed104a90e0b7dbe9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds the specified entry to the map. <ahref="#ac08a8c7641c7c68aed104a90e0b7dbe9">More...</a><br/></td></tr>
<trclass="memdesc:aeb573dee291df27a7297be30c18fda38"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the value for the given key. <ahref="#aeb573dee291df27a7297be30c18fda38">More...</a><br/></td></tr>
<trclass="memitem:af8808b2694bb6efcba40a5879b5cb505"><tdclass="memItemLeft"align="right"valign="top">Dictionary< String, String > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcom_1_1mxgraph_1_1mxImageBundle.html#af8808b2694bb6efcba40a5879b5cb505">images</a> = new Dictionary<String, String>()</td></tr>
<trclass="memdesc:af8808b2694bb6efcba40a5879b5cb505"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Maps from keys to images. <ahref="#af8808b2694bb6efcba40a5879b5cb505">More...</a><br/></td></tr>
<trclass="memdesc:ae9680e72d45e7c06aa42e950ef765b63"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the images. <ahref="#ae9680e72d45e7c06aa42e950ef765b63">More...</a><br/></td></tr>
<divclass="textblock"><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>
<p>To add a new image bundle to an existing graph, the following code is used:</p>
<p><aclass="el"href="classcom_1_1mxgraph_1_1mxImageBundle.html"title="Maps from keys to base64 encoded images or file locations. All values must be URLs or use the format ...">mxImageBundle</a> bundle = new mxImageBundle(); bundle.PutImage("myImage", "data:image/gif,R0lGODlhEAAQAMIGAAAAAICAAICAgP" + "//AOzp2O3r2////////yH+FUNyZWF0ZWQgd2l0aCBUaGUgR0lNUAAh+QQBCgAHACwAAAAA" + "EAAQAAADTXi63AowynnAMDfjPUDlnAAJhmeBFxAEloliKltWmiYCQvfVr6lBPB1ggxN1hi" + "laSSASFQpIV5HJBDyHpqK2ejVRm2AAgZCdmCGO9CIBADs="); graph.AddImageBundle(bundle);</p>
<p>The image can then be referenced in any cell style using image=myImage.</p>
<p>To convert a given Image to a base64 encoded String, the following code can be used:</p>
<p>MemoryStream ms = new System.IO.MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); byte[] data = ms.ToArray(); Console.WriteLine("base64="+Convert.ToBase64String(data));</p>
<p>The value is decoded in <aclass="el"href="classcom_1_1mxgraph_1_1mxUtils.html#a2a71827c05120b140caa51409a363282"title="Loads an image from the local filesystem, a data URI or any other URL. ">mxUtils.LoadImage</a>. The keys for images are resolved and the short format above is converted to a data URI in mxGraph.postProcessCellStyle. </p>
</div><h2class="groupheader">Member Function Documentation</h2>
<p>Referenced by <aclass="el"href="classcom_1_1mxgraph_1_1mxGraph.html#abcf2c8640c3a2645b92bc899a40bda57">com.mxgraph.mxGraph.GetImageFromBundles()</a>.</p>