在我的情况下,我没有使用 RenderSurfaceView。我想对我的场景进行屏幕截图。但是当我保存屏幕截图时,它会显示倒置的镜像。无法理解我在这里做错了什么。
这是我的代码
attachChild(screenCapture);
share_clicked = 1;
final int viewWidth = (int)camera.getWidth();
final int viewHeight = (int)camera.getHeight();
Log.d("camera width", "View width :" + viewWidth);
Log.d("camera height", "View height :" + viewHeight);
File direct = new File(
Environment.getExternalStorageDirectory()
+ "/Word");
if (!direct.exists()) {
if (direct.mkdir())
; // directory is created;
}
screenCapture.capture(
viewWidth,
viewHeight,
direct.getAbsolutePath() + "/word"
+ System.currentTimeMillis() + ".png",
new IScreenCaptureCallback() {
public void onScreenCaptured(
final String pFilePath) {
activity
.runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(
activity,
"Image Successfully saved to 'Word' folder in SD Card.",
Toast.LENGTH_SHORT)
.show();
}
});
}
public void onScreenCaptureFailed(
final String pFilePath,
final Exception pException) {
activity.runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(
activity,
"Failed saving the image! Please check SD card.",
Toast.LENGTH_SHORT)
.show();
}
});
}
});
![这是我得到的屏幕截图1
如果有人能帮我找到这个,那将是一个很大的帮助。谢谢。