I use the JXL API to add an Image to an Excel file. Libraries used:
jcommon (1.0.14)
jfreechart (1.0.13)
jxl (2.6.10)
// chartImage is of type BufferedImage
com.KeyPoint.PngEncoder encoder = new com.KeyPoint.PngEncoder(chartImage, true, 0, 0);
jxl.write.WritableImage image = new jxl.write.WritableImage(0, 2, (chartImage.getWidth()/100),16,
encoder.pngEncode());
sheet.addImage(image);
The problem is that the WritableImage constructors take widths and heights in terms of rows and columns (width: column 0 to column chartImage.getWidth()/100, height: row 2 to row 16). This causes the chart image to blur.
How do I get the original image into the Excel using JXL? Kindly help. Thanks! :-)