This discussion is archived
1 Reply Latest reply: Jun 26, 2009 4:34 AM by 843851 RSS

Layers in graphics

843851 Newbie
Currently Being Moderated
Hi

I managed to display a 720x576 PNG image with transparancy on the TV screen but when I try to draw graphics or display text; these go behind the image and cannot be displayed.

How do i make draw on top of the image?

Draw image code
if(g instanceof DVBGraphics){
            try{
                ((DVBGraphics)g).setDVBComposite(DVBAlphaComposite.Src);
            }catch(Exception e){
                System.out.println("  !! setDVBComposite throws: " + e);
            }
        }
        
        // Peter
        DVBAlphaComposite compositeRule = DVBAlphaComposite.getInstance(DVBAlphaComposite.SRC_OVER, (float)0.5);
        DVBGraphics image = (DVBGraphics)g;
        try {
        image.setDVBComposite(compositeRule);
        }
        catch (org.dvb.ui.UnsupportedDrawingOperationException ex) {
        System.out.println("Exception: " + ex);
        }
        image.drawImage(base_image,0,0,null); 
Draw code
g.setColor(lowerRectCol);
            g.fillRect(xPosOfRectangle, 3*compHeight/4, compWidth/4, compHeight/4);