public static BufferedImage createBufferedImage(mxGraph graph,
Object[] cells, double scale, final Color background,
final boolean antiAlias, mxRectangle clip,
final mxGraphics2DCanvas graphicsCanvas)
{
mxImageCanvas canvas = (mxImageCanvas) drawCells(graph, cells, scale,
clip, new CanvasFactory()
{
public mxICanvas createCanvas(int width, int height)
{
return new mxImageCanvas(graphicsCanvas, width, height,
background, antiAlias);
}
});
return (canvas != null) ? canvas.destroy() : null;
}