Ujjal boruah Vinod
Ujjal boruah Vinod

Reputation: 59

about EncodedImage in Blackberry

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

Answers (2)

kehers
kehers

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

Vivek Kumar Srivastava
Vivek Kumar Srivastava

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

Related Questions