tags:

views:

47

answers:

1

in my blackberry application i have to create a effect in which fullscreen bitmap is slowly disappearing and ui screen is coming up.

protected void paint(Graphics g) {
        g.setGlobalAlpha(globalAlpha);//starting value of globalAlpha is 255.
        g.drawBitmap(0, 0, getWidth(), getHeight(), _bitmap, 0, 0);
        g.setGlobalAlpha(255 - globalAlpha);
        globalAlpha--;
        super.paint(g);
    }

This code is just for giving demo that what i want. super.paint(g) is calling 255 times because of that its a poor code. in one timer task i am calling invalidate();

So any suggestions how to implement this?

A: 

If you can get away with using 5.0 APIs, you'll save yourself a LOT of work by using the TransitionContext class. One of the transition types is "fade".

Marc Novakowski
yeah i know because of that in question i have specifically mentioned os 4.5
Vivart
heh - I must have skipped the title and went straight to the question!
Marc Novakowski
its OK but i have to stick with os 4.5. i have tried with Display.screenshot(_bitmap) also but on real device its throwing exception.
Vivart