Aspose.Slides for Java 15.9.0 的公共 API 和向后不兼容的更改

公共 API 更改

com.aspose.slides.ISlide、Slide 添加了 renderToGraphics 方法

添加了以下方法:

renderToGraphics(boolean withNotes, java.awt.Graphics2D graphics, int width, int height); renderToGraphics(boolean withNotes, java.awt.Graphics2D graphics, float scale); renderToGraphics(boolean withNotes, java.awt.Graphics2D graphics); 这些方法被添加到 com.aspose.slides.ISlide 接口和 com.aspose.slides.Slide 类中。此方法允许将幻灯片渲染到指定的 Graphics2D 对象。


 BufferedImage bufferedImage = new BufferedImage(960, 720, BufferedImage.TYPE_INT_ARGB);

Graphics2D g2d = bufferedImage.createGraphics();

Presentation pres = new Presentation("SomePresentation.pptx");

pres.getSlides().get_Item(0).renderToGraphics(false, g2d, bufferedImage.getWidth(), bufferedImage.getHeight());

g2d.dispose();

ImageIO.write(bufferedImage, "png", fileName);