PDA

View Full Version : How to display a .GIF image?


forcedfx
02-20-2007, 08:07 PM
How does one go about displaying a GIF image within an application? I've read that it is possible to display bitmaps but what about gifs?

Skipper_Joe
02-21-2007, 03:52 AM
You can created EncodedImage object using static methods EncodedImage.createEncodedImage() and draw it using one of Graphics.drawImage() methods.

forcedfx
02-21-2007, 01:28 PM
Thanks Skipper I managed to figure out how to create the encoded image. Now I just have to figure out how to display it on my MainScreen. I'll post a separate thread for that.

Skipper_Joe
02-22-2007, 05:58 AM
You ale welcome!

I did it next way:
- extend net.rim.device.api.ui.Field and override method paint(Graphics g).
- call g.drawImage(startX, startY, width, height, image, 0, left, top) inside overriden paint(),
where image is EncodedImage object.