Hi Reinhard,

    I have met the same problem with you in your post in 2009 , I want to
know how you solved this problems. 
    I use the following statements to make the image looks transparent. but
unfortunately, the background is solid black, and hide the other background
image. 

add(new Image("dynamic", new RenderedDynamicImageResource(100, 100) {
                        @Override
                        protected boolean render(Graphics2D graphics, 
Attributes attrs) {
                                // TODO Auto-generated method stub
                                //setType(BufferedImage.TYPE_4BYTE_ABGR);
                                
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR,
0.0f));
                                Rectangle2D.Double rect = new 
Rectangle2D.Double(0, 0, 100, 100);
                                graphics.fill(rect);
                                graphics.setColor(Color.RED);
                                graphics.drawString("测试", 10, 10);
                                return true;
                        }
                }));

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-have-a-RenderedDynamicImageResource-with-transparent-background-tp1843737p4677720.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to