0

嗨,这是我的代码。

public static void TakeScreenShot(String FileName)
{ 
         Log.d("Screen"," Path "+ FileName);

        scr.capture(CAMERA_WIDTH, CAMERA_HEIGHT, FileName, new IScreenCaptureCallback() {
            @Override
            public void onScreenCaptured(final String pFilePath) { 
                Log.d("Screen","Yes "+ pFilePath);

            }

            @Override
            public void onScreenCaptureFailed(final String pFilePath, final Exception pException) { 
                Log.d("Screen","NO "+ pFilePath+"    "+pException);

            }
        });
    }

第一个日志工作正常。但是没有其他日志正在工作。它没有完成也没有失败。谁能给我一个解决方案?

我保存的路径是“/mnt/sdcard/cmtdd.png”

4

1 回答 1

1

以下可能有效..我添加了 scene.attachChild(screenCapture); 到你的代码。它应该在正确的地方使用。

public static void TakeScreenShot(String FileName)
{ 
         Log.d("Screen"," Path "+ FileName);

        scene.attachChild(screenCapture); // Attaching screen capture after all rendered.

        scr.capture(CAMERA_WIDTH, CAMERA_HEIGHT, FileName, new IScreenCaptureCallback() {
            @Override
            public void onScreenCaptured(final String pFilePath) { 
                Log.d("Screen","Yes "+ pFilePath);

            }

            @Override
            public void onScreenCaptureFailed(final String pFilePath, final Exception pException) { 
                Log.d("Screen","NO "+ pFilePath+"    "+pException);

            }
        });
    }
于 2012-09-09T03:28:00.453 回答