Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
RapsFan
Posts: 442
Registered: ‎08-02-2010
My Device: Z10

Re: Draw fields in foreground, image in back

The initial frame draws fine, its only after the fieldChanged call to increment the frame index that it goes all screwy.
Developer
Aman_vivek
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520

Re: Draw fields in foreground, image in back

if you have gif with white color so change your paint method with

 

 

protected void paint(Graphics graphics) {
        super.paint(graphics);
        graphics.setColor(Color.Black);
        graphics.fillRect(0,0,Display.getWidth(),Display.getHeight());
                // Draw the animation frame.
                graphics.drawImage(_xPos, _yPos, _image.getFrameWidth(_currentFrame), _image.getFrameHeight(_currentFrame), _image, _currentFrame, 0, 0);
    }

 

 

because I downloaded a animated GIF from internet. And its work fine.

 

Thanks

Vivek kumar Srivastava

Developer
RapsFan
Posts: 442
Registered: ‎08-02-2010
My Device: Z10

Re: Draw fields in foreground, image in back

Thanks a lot Aman. Just got home and tried your code. I also downloaded another animated giff and had no problems or distoration, so there must be a problem with my .gif. anyway thanks a lot :smileyhappy: