mxImageBundle

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.

$bundle = new mxImageBundle();
$bundle->putImage("myImage", "data:image/gif,R0lGODlhEAAQAMIGAAAAAICAAICAgP".
  "//AOzp2O3r2////////yH+FUNyZWF0ZWQgd2l0aCBUaGUgR0lNUAAh+QQBCgAHACwAAAAAEA".
  "AQAAADTXi63AowynnAMDfjPUDlnAAJhmeBFxAEloliKltWmiYCQvfVr6lBPB1ggxN1hilaSS".
  "ASFQpIV5HJBDyHpqK2ejVRm2AAgZCdmCGO9CIBADs=");
$graph->addImageBundle($bundle);
(end);

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));

The value is decoded in mxUtils.loadImage.  The keys for images are resolved and the short format above is converted to a data URI in mxGraph.postProcessCellStyle.

Summary
mxImageBundleMaps from keys to base64 encoded images or file locations.
Variables
imagesMaps from keys to images.
Functions
mxImageBundleConstructs a new image bundle.
getImagesReturns the images.
putImageAdds the specified entry to the map.
getImageReturns the value for the given key.

Variables

images

var $images

Maps from keys to images.

Functions

mxImageBundle

function mxImageBundle()

Constructs a new image bundle.

getImages

function getImages()

Returns the images.

putImage

function putImage($key,
$value)

Adds the specified entry to the map.

getImage

function getImage($key)

Returns the value for the given key.

var $images
Maps from keys to images.
function mxImageBundle()
Constructs a new image bundle.
function getImages()
Returns the images.
function putImage($key,
$value)
Adds the specified entry to the map.
function getImage($key)
Returns the value for the given key.
static function loadImage($url)
Loads an image from the local filesystem, a data URI or any other URL.
function postProcessCellStyle($style)
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.
Close