Hi,
I’m trying to get color transparency of the OuterShadow applied on first shape, but I can’t get correct value. Please see attached screenshot.
Here’s the code I use:
String presentationPath = “ShadowsTest.pptx”;
InputStream stream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(stream);
stream.close();
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape firstShape = (IAutoShape) slide.getShapes().get_Item(0);
IOuterShadow firstShapeShadow = firstShape.getEffectFormat().getOuterShadowEffect();
System.out.println("Text: " + firstShape.getTextFrame().getParagraphs().get_Item(0).getText());
System.out.println("Blur Radius: " + firstShapeShadow.getBlurRadius());
System.out.println("Angle/Direction: " + firstShapeShadow.getDirection());
System.out.println("Distance: " + firstShapeShadow.getDistance());
System.out.println("Color Type: " + firstShapeShadow.getShadowColor().getColorType());
System.out.println("Color: " + firstShapeShadow.getShadowColor().getColor().toString());
System.out.println("Transparency: " + firstShapeShadow.getShadowColor().getColor().getTransparency());
System.out.println("Alpha: " + firstShapeShadow.getShadowColor().getColor().getAlpha());
And here’s the output:
Text: Shadow effect applied on whole shape.
Blur Radius: 4.0
Angle/Direction: 45.0
Distance: 3.0
Color Type: 0
Color: java.awt.Color[r=127,g=0,b=0]
Transparency: 3
Alpha: 51
How to get transparency of 80%?
Thanks,
Zeljko
Zeljko