Two step process really.

1. Find out the images size using a little bit of Java code like this;

BufferedImage bimg = ImageIO.read(new File(filename));
int width = bimg.getWidth();
int height = bimg.getHeight();

2. Insert the image into the sheet. If you take a look at this rather large
example -
http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
- it contains all you could need to know about inserting images into
worksheets. I do not suggest you use this class as is if you are working
with lots of images as that was not it's original intention. Rather strip
out the code you need and include it into your class/classes.



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Insert-Image-in-a-cell-with-its-original-dimensions-tp5712642p5712646.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to