Reputation: 59
Suppose i have an animated GIF image name test.GIF added to my project in BlackBerry JDE to be used in AnimatedGIFField class. and now i need to convert it to Encoded image. In the reference it is given to create encoded image the following function
public static EncodedImage createEncodedImage(byte[] data, int offset, int length)
Plz give me the code to convert test.GIF to encoded image????
Upvotes: 0
Views: 333
Reputation: 4170
By the way, casting EncodedImage to GIFEncodedImage fails on OS7. You have to rename your gif extension to .agif to make it work.
Upvotes: 0
Reputation: 2158
use this code
EncodedImage encImg = GIFEncodedImage.getEncodedImageResource("test.gif");
if you need GIFEncodedImage
then cast encImg
to GIFEncodedImage
.
GIFEncodedImage img = (GIFEncodedImage) encImg;
Upvotes: 1