tangdeqing / loon-simple

Automatically exported from code.google.com/p/loon-simple
0 stars 0 forks source link

GraphicsUtils.loadImage().getBitmap()性能问题 #31

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
测试图片:图片大小为116k,300*300。
----------------------代码如下---------
//计时
SystemTimer timer = new SystemTimer();
long startTime = timer.getTimeMillis();
image = 
GraphicsUtils.loadImage(baseImagePath+imagesName[imagesCur]).getBitmap();
long endTime = timer.getTimeMillis();
if(LSystem.DEBUG) log.println("loadImage---passing 
time:["+(endTime-startTime)+"]");
-------------------------
打印:
loadImage---passing time:[1056]
-------------------------
结论:
用此方法获取Bitmap会有性能问题。

Original issue reported on code.google.com by javalur...@gmail.com on 30 Dec 2010 at 8:30

GoogleCodeExporter commented 8 years ago
忘说了,使用的是LGame-0.2.9,
android平台的

Original comment by javalur...@gmail.com on 30 Dec 2010 at 8:33

GoogleCodeExporter commented 8 years ago
您好,loadImage内部有数据缓存,所以首次加载会比较耗时,��
�果您仅需将图片加载为Bitmap,完全可以使用GraphicsUtils.loadBitm
ap。

Original comment by loontest@gmail.com on 27 Jan 2011 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by loontest@gmail.com on 27 Jan 2011 at 2:23