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
Forums Advisor I
vaishali28
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Problem in adding animated gif image

Hi i want to add an animated gif image in my application.

And for that i have used this code.

http://clusterlessons.blogspot.in/2011/08/adding-animated-gif-file-for-loading.html

 

Its working fine with some image but showing unexpectlted result with the other.

Originally the speed of the image is slow while i open it in browser, but in device its moving to fast.

I have increased the frame delay, even then the problem is not solved. is there any way to rotate the image??

Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem in adding animated gif image

I wish people would actually reference their source rather than just cut/pasting code and indirectly claiming it as their own....

 

The article you have used is just a copy of this one:

http://supportforums.blackberry.com/t5/Java-Development/Display-an-animated-GIF/ta-p/445014

which as you can see from the date is earlier.

 

The thing I have found about this code is that whether it works or not is a little dependent on the type of animated gif you actually have.  Some gifs generate frames that are 'deltas' from the previous one, so you have to paint the previous frames as well as the last one to get the effect.  Some are complete in their own right, so you only need to paint a single frame. 

 

So investigate the options used to define the gif file that is causing the problem and generate it in an alternative way. 

 

If you want more detailed comment, probably the best option is to attach two gif files, one working correctly and one not, to this Thread and perhaps someone here who has experience with drawing packages can explain what it different and so causing the differences you see.   

 

Also search the forum for other references to this code - other people have had issues using it and perhaps you will find a matching problem.   

Please use plain text.
Forums Advisor I
vaishali28
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in adding animated gif image

[ Edited ]

Yes i have taken the code from the above specified link.

The image which is working is

 

and the image which is not working properly using this code is

Please use plain text.
Forums Advisor I
vaishali28
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Problem in adding animated gif image

Hi i want to slow down the animation speed of the image.

Originally the animation speed is not fast but when i run it in my app , its moving very fast.

I have increased the framedelay also but still the animation speed is not affected.

Please use plain text.
Developer
sajit56
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator

Re: Problem in adding animated gif image

You must know how many frames are there, on the basis of frames you should decide the delay.

As you take code from a link try to run full project and compare you code with that, even compare GIF image too and you will find problem.

Regards,
Ajit Sharma
Please use plain text.