You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by freemarket <hk...@iscs-i.com> on 2011/06/19 21:56:24 UTC

Poor Image quality when using JFreeChart generated Images in HSLF

Hi,
When using an image generated in JFreeChart which appears crisp in web
browser, same image appears blurry when
embedded as Picture within HSLF slideshow. Here are some details:

image generated by standard chart factory and saved as:

new BufferedImage(width, height, BufferedImage.TYPE_INT_RBG)

image is then read in by:

ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] bytesOut = null;
int picNdx = -1;
try {
    ImageIO.write(img, imgType, baos);
    bytesOut = baos.toByteArray();
    baos.close();
    picNdx = ppt.addPicture(bytesOut, Picture.PNG);
} catch (IOException e) {
.
.

Where imgType = "png"

the dimensions for the anchor are the same as the images dimensions
specified by the JFreeChart method.
The image always looks blurry. I suspect the default size of the Picture to
have something to do with this
in regards to the POINT_DPI/PIXEL_DPI yet I never invoke the
Picture.setDefaultSize() method.

Any suggestions as to how to enhance the crispness of the embedded image?

Thanks,
Henry


--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Poor-Image-quality-when-using-JFreeChart-generated-Images-in-HSLF-tp4504325p4504325.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Poor Image quality when using JFreeChart generated Images in HSLF

Posted by Yegor Kozlov <ye...@dinom.ru>.
What happens if you open PowerPoint and manually insert an image
generated JFreeChart? Does it look blurry too?

Yegor

On Sun, Jun 19, 2011 at 11:56 PM, freemarket <hk...@iscs-i.com> wrote:
> Hi,
> When using an image generated in JFreeChart which appears crisp in web
> browser, same image appears blurry when
> embedded as Picture within HSLF slideshow. Here are some details:
>
> image generated by standard chart factory and saved as:
>
> new BufferedImage(width, height, BufferedImage.TYPE_INT_RBG)
>
> image is then read in by:
>
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> byte[] bytesOut = null;
> int picNdx = -1;
> try {
>    ImageIO.write(img, imgType, baos);
>    bytesOut = baos.toByteArray();
>    baos.close();
>    picNdx = ppt.addPicture(bytesOut, Picture.PNG);
> } catch (IOException e) {
> .
> .
>
> Where imgType = "png"
>
> the dimensions for the anchor are the same as the images dimensions
> specified by the JFreeChart method.
> The image always looks blurry. I suspect the default size of the Picture to
> have something to do with this
> in regards to the POINT_DPI/PIXEL_DPI yet I never invoke the
> Picture.setDefaultSize() method.
>
> Any suggestions as to how to enhance the crispness of the embedded image?
>
> Thanks,
> Henry
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/Poor-Image-quality-when-using-JFreeChart-generated-Images-in-HSLF-tp4504325p4504325.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org