How to set the alpha component of an annotation?

44 views
Skip to first unread message

Shirley Gong

unread,
Jun 2, 2014, 6:13:47 PM6/2/14
to pdfne...@googlegroups.com
Q: One question regarding setting a color on our Square. The Square (which should actually be called Rectangle) has set*Color methods. The paramter ColorPt class takes x,y,z,w params (which should be called r,g,b). What i am struggling with is setting the alpha of the color. the w parameter does not seams to be alpha. How would i set the alpha component of my Squares color, or how could i turn the square semi transparent?

A: No, the ColorPt class does not take into account of opacity. The three params constructor is for RGB and the four params constructor is for CMYK. 
However, you could use the Markup class setOpacity method. 
i.e. 
Markup m = new Markup(annot);
m.setOpacity(opacity);
Reply all
Reply to author
Forward
0 new messages