相关疑难解决方法(0)

渲染大型Bitmap的小区域非常耗时

我有以下代码.

this.getGame().getGraphics().drawBitmap(Assets.playScreen_LaserBeamAnimation, new Rect(0, 0, 100, 750), new Rect(0, 0, 100, 750), null);
this.getGame().getGraphics().drawBitmap(Assets.playScreen_LaserBeamAnimation, new Rect(0, 200, 10, 800), new Rect(0, 0, 200, 600), null);
Run Code Online (Sandbox Code Playgroud)

第一个render语句0.6 - 1 second用于渲染.第二个围绕着1 millisecond.

位图很大:968 KB并加载以下代码:

public Bitmap readAssetsBitmap(String filename) throws IOException {
        try {
            BitmapFactory.Options options = new BitmapFactory.Options(); 
            options.inPurgeable = true;
            Bitmap bitmap = BitmapFactory.decodeStream(assets.open(filename), null, options);
            if(bitmap == null) {
                WSLog.d(Game.GAME_ENGINE_TAG, this,"File cannot be opened: It's value is null");
                throw new IOException("File cannot be opened: …
Run Code Online (Sandbox Code Playgroud)

java android bitmap

7
推荐指数
1
解决办法
680
查看次数

ImageMagick的.将图像切割成子图块的正确方法是什么

将图像切成N×N子图块图像的正确方法是什么?

谢谢,
道格

imagemagick

3
推荐指数
1
解决办法
3039
查看次数

标签 统计

android ×1

bitmap ×1

imagemagick ×1

java ×1