我將手機放在「縱向模式」下,但cameraPreview
處於橫向模式(即我看到旋轉90度的東西)。當我將手機放在「橫向模式」下時,預覽很好,處於「橫向模式」,圖像不旋轉。 我無權訪問Camera.setDisplayOrientation(int)
,因此我無法使用解釋爲here的方法。安卓相機處於橫向模式,但用於縱向模式
我已經試過:
Camera.Parameters p = camera.getParameters();
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
p.set("orientation", "portrait");
p.set("rotation",90);
}
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
p.set("orientation", "landscape");
p.set("rotation", 90);
}
絕對投下的投票,你可以閱讀和幫助。 – morg 2013-02-11 14:32:02
或者,你可以解釋[你曾嘗試過](http://mattgemmell.com/2008/12/08/what-have-you-tried/)?它通常比通用的「我該如何做X?」更好。 – Geobits 2013-02-11 14:38:22