开发者

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 leng开发者_如何学运维th)

Plz give me the code to convert test.GIF to encoded image????


use this code

EncodedImage encImg = GIFEncodedImage.getEncodedImageResource("test.gif");

if you need GIFEncodedImage then cast encImg to GIFEncodedImage.

GIFEncodedImage img = (GIFEncodedImage) encImg;


By the way, casting EncodedImage to GIFEncodedImage fails on OS7. You have to rename your gif extension to .agif to make it work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜