Hi,
the following code produces the attached ppt.
But the from center option gives different visual in Powerpoint
Note : I am using 1.7.4 java slides.
try
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation(new FileInputStream(new File(“source.ppt”)));
//Accessing a slide using its slide position
Slide slide = pres.getSlideByPosition(1);
//Disable following master background settings
slide.setFollowMasterBackground(false);
//Setting the fill type of the background to gradient
slide.getBackground().getFillFormat().setType(FillType.GRADIENT);
//Setting the type of the gradient color
slide.getBackground().getFillFormat().setGradientColorType(GradientColorType.ONE_COLOR);
//Setting the gradient style
slide.getBackground().getFillFormat().setGradientStyle(GradientStyle.FROM_CENTER);
//Setting the background color to blue
slide.getBackground().getFillFormat().setForeColor(java.awt.Color.BLUE);
//Setting the degree of the gradient
// slide.getBackground().getFillFormat().setGradientDegree(18);
//Writing the presentation as a PPT file
pres.write(new FileOutputStream(new File(“modified.ppt”)));
}
catch(Exception ex)
{
System.out.println(ex.toString());
}