Not available in JavaScript or PHP Embedders.
Syntax myPopChart.getImageData();
Description Returns a byte array representation of the PopChart image, suitable for saving or for returning to a client.
To save this image in Java, you would create a new DataOutputStream, and write the results of this method using the writebytes method, as shown in Example 4.8.
Example 4.8 Saving the Results of getImageData()
DataOutputStream saveImage = new DataOutputStream(filename);
You can also use this method in a Java Servlet to return an image to a browser. Be sure to tell the browser the length of the image and the image's mime type. "Table of MIME Types" in Chapter 14 lists the mime types for each of PopChart Server's image formats.
Example 4.9 shows how to return an image using getImageData() in a Java servlet.
Example 4.9 Returning the Results of getImageData() to a Browser
response.setContentType("application/x-shockwave-flash");
response.setHeader("Expires", "-1");
response.setHeader("nPragma", "no-cache");
BufferedOutputStream returnImage = new BufferedOutputStream(response.getOutputStream());
byte[] imageData = myPopChart.getImageData();