Creates a new image export instance to be used with an export canvas. Here is an example that uses this class to create an image via a backend using <mxXmlExportCanvas>.
var xmlDoc = mxUtils.createXmlDocument();
var root = xmlDoc.createElement('output');
xmlDoc.appendChild(root);
var xmlCanvas = new mxXmlCanvas2D(root);
var imgExport = new mxImageExport();
imgExport.drawState(graph.getView().getState(graph.model.root), xmlCanvas);
var bounds = graph.getGraphBounds();
var w = Math.ceil(bounds.x + bounds.width);
var h = Math.ceil(bounds.y + bounds.height);
var xml = mxUtils.getXml(root);
new mxXmlRequest('export', 'format=png&w=' + w +
'&h=' + h + '&bg=#F9F7ED&xml=' + encodeURIComponent(xml))
.simulate(document, '_blank');| mxImageExport | Creates a new image export instance to be used with an export canvas. |
| Functions | |
| mxImageExport | Constructs a new image export. |
| Variables | |
| includeOverlays | Specifies if overlays should be included in the export. |
| Functions | |
| drawState | Draws the given state and all its descendants to the given canvas. |
| drawState | Draws the given state and all its descendants to the given canvas. |
| getLinkForCellState | Returns the link for the given cell state and canvas. |
| drawCellState | Draws the given state to the given canvas. |
| drawShape | Draws the shape of the given state. |
| drawText | Draws the text of the given state. |
| drawOverlays | Draws the overlays for the given state. |
mxImageExport.prototype.drawOverlays = function( state, canvas )
Draws the overlays for the given state. This is called if includeOverlays is true.
Constructs a new image export.
function mxImageExport()
Specifies if overlays should be included in the export.
mxImageExport.prototype.includeOverlays
Draws the given state and all its descendants to the given canvas.
mxImageExport.prototype.drawState = function( state, canvas )
Returns the link for the given cell state and canvas.
mxImageExport.prototype.getLinkForCellState = function( state, canvas )
Draws the given state to the given canvas.
mxImageExport.prototype.drawCellState = function( state, canvas )
Draws the shape of the given state.
mxImageExport.prototype.drawShape = function( state, canvas )
Draws the text of the given state.
mxImageExport.prototype.drawText = function( state, canvas )
Draws the overlays for the given state.
mxImageExport.prototype.drawOverlays = function( state, canvas )