public void send(ResourceContext context) throws IOException {
ImageData data = (ImageData) restoreData(context);
ImageRenderer renderer = (ImageRenderer) getRenderer(context);
FacesContext facesContext = FacesContext.getCurrentInstance();
try {
BufferedImage image = renderer.createImage(data._width,data._height);
Graphics2D graphics = image.createGraphics();
try {
if (data._bgColor != 0) {
Color color = new Color(data._bgColor);