You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Andreas Korthaus <ak...@web.de> on 2005/10/03 10:47:34 UTC

add image with 100% of original size to a spreadsheet

Hi!

Is there a way to add an image (png) to a spreadsheet, in 1:1 size?
If I have an image with a size of 380 x 380 pixel, I don't know how to 
add it to a spreadsheet, so that it gets displayed with exact 380x380 
pixels (100%). That's a problem, because the image contains some lines 
with 1px, and if you resize it, it looks really bad.

But if I add an image to an Excel File using MS Excel 2000, I've 
noticed, that if I resize one of the cols where the image is, it also 
gets resized!
So it seems to me, that "new HSSFClientAnchor()" is the way, how it is 
done with MS Excel too.

But can I rely on a default column width of 64 pixel? If I can rely on 
this, I can calculate how to display the image with 100%. But if there 
are Excel Version/Settings... which change this value, I'll get crappy 
images again.

What would you recommend to display images with 100% size (without 
resizing) in a Spreadsheet?

best regards
Andreas

PS: Other libraries, like Perl Spreadsheet_ExcelWriter can add images 
with 100% size, but they only support 24bit BMP, which makes the files 
ridiculously large.




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/