5
W mojej sytuacji nie używałem RenderSurfaceView. Chcę zrobić zrzut ekranu mojej sceny. Ale kiedy zapisuję zrzut ekranu, pokazuje odwrócone lustrzane odbicie. Nie rozumiem, co robię źle tutaj.Screen Capture w andengine daje odwrócone lustro obrazu
Oto mój kod
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();
}
});
}
});
! [Jest to zrzut ekranu i dostaje 1
Byłoby to bardzo pomocne, jeśli ktoś może to szukał dla mnie. Dzięki.
Dzięki za te rzeczy. – Siddharth
W rzeczywistości wystąpił błąd, jeśli pGrabY jest inny niż 0, generuje wyjątek ArrayOutOFBoundsException. Wiersz powinien wynosić 'pixels [x + (pGrabHeight - y - 1) * pGrabWidth] = pixelsARGB_8888 [x + y * pGrabWidth];' bez pGrabY w drugiej części przypisania. – Orgmir