它是更好地使用位图或EN codeDIMAGE黑莓? [英] Is it better to use Bitmap or EncodedImage in BlackBerry?

查看:148
本文介绍了它是更好地使用位图或EN codeDIMAGE黑莓?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在黑莓手机,是它更好地使用内存使用和性能方面的Bitmap类或EN codeDIMAGE?有没有使用这些类的任何具体的建议吗?

In BlackBerry, is it better to use the Bitmap class or EncodedImage in terms of memory usage and performance? Are there any specific tips on using these classes?

推荐答案

我的观察是,更好的:


  • 使用位图和drawBitmap为需要经常重新绘制元素(例如背景,游戏图片)

也许是因为位图是一个原始格式,因此对于之前的drawImage解码恩codeDIMAGE没有性能损失。在另一边,GIF动画与恩codeDIMAGE完美的作品。

Maybe it's because Bitmap is a raw format so no performance hit for decoding EncodedImage before drawImage. On the other side, GIF animation works perfectly with EncodedImage.


  • 使用恩codeDIMAGE对动画或大量的资源(例如照片或德科雷元素)

当你从GIF,PNG,他们无论如何都会被开辟为一间codeDIMAGE JPG格式的加载位图,如果你这样做了很多次,它可能会击败性能(例如50秒加载从资源14巴纽大胆,平均尺寸为80 KB的位图,调谐到2秒装入恩codedImages)

When you load Bitmap from gif, png, jpg formats they will be opened as an EncodedImage anyway, and if you do this many times, it may beat performance (ex 50 seconds to load 14 png from resources to Bitmaps on bold, avg size 80 kb, tuned up to 2 seconds loading into EncodedImages)

更新 stated通过Fostah 恩codeDIMAGE有,你可以用任何恩codeDIMAGE转换为位图getBitmap()函数。所以,你可以在恩codeDIMAGE加载,然后利用为位图

UPDATE stated by Fostah EncodedImage has a getBitmap() function that you can use to convert any EncodedImage to a Bitmap. So you can load in EncodedImage and then use as Bitmap

这篇关于它是更好地使用位图或EN codeDIMAGE黑莓?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆