I pretty sure I have found a bug in the S60 implementation of JSR-226.
The code below should not produce any visible output but there is a grey box visible on a S60 emulator or device.
Its seems to be the combination of using ScalableGraphics.setTransparency() with a value less than 1 and Graphics.setClip() with a clip region less that full screen.
Has anyone come across this before? Can anyone figure out a workaround? Having to set the clip to full screen is seriously effecting the performance of my app :-(
Code:import javax.microedition.m2g.*; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class Midlet extends MIDlet { public void startApp() { Canvas canvas = new Canvas() { protected void paint(Graphics g) { g.setClip(getWidth()/4, getHeight()/4, getWidth()/2, getHeight()/2); ScalableGraphics sg = ScalableGraphics.createInstance(); sg.setTransparency(0.5f); sg.bindTarget(g); sg.render(0, 0, SVGImage.createEmptyImage(null)); sg.releaseTarget(); } }; Display.getDisplay(this).setCurrent(canvas); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }

Reply With Quote

