Maybe someone can tell me is it possible to scale Slide image (draw
method) to given dimensions (without quaity loose), because I am
searching without result.
Anyone knows that ?
Regards

[email protected] pisze:
Hi, All!

I am using POI to display slides from PPT as Images in swing.
And I have a problem with size of images I get from draw method of Slide class. I would like to set size of received image as 1024x768 but I do not know how to do this (by default it has smaller dimensions).

*SlideShow ppt = new SlideShow(new HSLFSlideShow(new FileInputStream(file)));* //ppt.setPageSize(new Dimension (1024,768)); // extends size of slides but do not fit content

           Dimension pgsize = ppt.getPageSize();
*Slide[] slide = ppt.getSlides();* BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB);
           Graphics2D graphics = img.createGraphics();
           graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
           *slide[0].draw(graphics);*
                      ImageIcon icn = new ImageIcon(img);

Is it possible to draw images in given dimensions?
If yes, how to do it ?

Best Regards



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

Reply via email to