maxGraph/dotnet/docs/html/classcom_1_1mxgraph_1_1mxIm...

147 lines
8.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>mxGraph: com::mxgraph::mxImageBundle Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>com</b>::<b>mxgraph</b>::<a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html">mxImageBundle</a>
</div>
</div>
<div class="contents">
<h1>com::mxgraph::mxImageBundle Class Reference</h1><!-- doxytag: class="com::mxgraph::mxImageBundle" -->
<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.
<a href="#_details">More...</a></p>
<p><a href="classcom_1_1mxgraph_1_1mxImageBundle-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html#ad60ca8c5a514a3864cac932a6b2d64cc">PutImage</a> (String key, String value)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds the specified entry to the map. <a href="#ad60ca8c5a514a3864cac932a6b2d64cc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">String&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html#a2eb0c5995f3ae3ce1b6bb68eeb48f72b">GetImage</a> (String key)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the value for the given key. <a href="#a2eb0c5995f3ae3ce1b6bb68eeb48f72b"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Dictionary&lt; String, String &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html#a8bfb4d67c74602df82b8b9b6e4ee6967">images</a> = new Dictionary&lt;String, String&gt;()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maps from keys to images. <a href="#a8bfb4d67c74602df82b8b9b6e4ee6967"></a><br/></td></tr>
<tr><td colspan="2"><h2>Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Dictionary&lt; String, String &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html#a171163596816aff46c669d5bb167b4b6">Images</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the images. <a href="#a171163596816aff46c669d5bb167b4b6"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<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><a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html" title="Maps from keys to base64 encoded images or file locations. All values must be URLs...">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 <a class="el" href="classcom_1_1mxgraph_1_1mxUtils.html#a30ccc3180a67c12649dbba8212918215" 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>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2eb0c5995f3ae3ce1b6bb68eeb48f72b"></a><!-- doxytag: member="com::mxgraph::mxImageBundle::GetImage" ref="a2eb0c5995f3ae3ce1b6bb68eeb48f72b" args="(String key)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">String com::mxgraph::mxImageBundle::GetImage </td>
<td>(</td>
<td class="paramtype">String&nbsp;</td>
<td class="paramname"> <em>key</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the value for the given key. </p>
</div>
</div>
<a class="anchor" id="ad60ca8c5a514a3864cac932a6b2d64cc"></a><!-- doxytag: member="com::mxgraph::mxImageBundle::PutImage" ref="ad60ca8c5a514a3864cac932a6b2d64cc" args="(String key, String value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void com::mxgraph::mxImageBundle::PutImage </td>
<td>(</td>
<td class="paramtype">String&nbsp;</td>
<td class="paramname"> <em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">String&nbsp;</td>
<td class="paramname"> <em>value</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Adds the specified entry to the map. </p>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a8bfb4d67c74602df82b8b9b6e4ee6967"></a><!-- doxytag: member="com::mxgraph::mxImageBundle::images" ref="a8bfb4d67c74602df82b8b9b6e4ee6967" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;String, String&gt; <a class="el" href="classcom_1_1mxgraph_1_1mxImageBundle.html#a8bfb4d67c74602df82b8b9b6e4ee6967">com::mxgraph::mxImageBundle::images</a> = new Dictionary&lt;String, String&gt;()<code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Maps from keys to images. </p>
</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="a171163596816aff46c669d5bb167b4b6"></a><!-- doxytag: member="com::mxgraph::mxImageBundle::Images" ref="a171163596816aff46c669d5bb167b4b6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Dictionary&lt;String, String&gt; com::mxgraph::mxImageBundle::Images<code> [get]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the images. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/utils/mxImageBundle.cs</li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Jul 20 11:32:32 2012 for mxGraph by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>