got it,Thank you!
HELP!!!
I use Slides.IAutoShape to add the watermark of PPT. How to set the watermark transparency, The following code is my relevant code.
image.png (30.9 KB)
@good_luck,
To set transparency for a shape, you can use the IFillFormat interface like this:
shape.getFillFormat().setFillType(FillType.Solid);
// 128 is the transparency value here
shape.getFillFormat().getSolidFillColor().setColor(new Color(150, 200, 0, 128));
Thanks for you answer. But transparency is a 0-1 floating point number, so how do you convert it?
@good_luck,
If your transparency values are strictly in [0; 1] range and 0 means fully opaque and 1 means fully transparent, you should convert the floating transparency value like this:
int alfa = (int)((1 - transparency) * 255);
If your transparency values change the other way around, you should convert them like this:
int alfa = (int)(transparency * 255);