当我使用我的Android相机处于肖像模式时,看到的图像是横向的 所以我写道:
Method rotateMethod;
rotateMethod = android.hardware.Camera.class.getMethod("setDisplayOrientation", int.class);
rotateMethod.invoke(camera, 90);
有效。然而,当我保存图像时,他的横向图像(宽度大于高度) 我该怎么做才能收集相机看到的图像(字节[])?
答案 0 :(得分:-2)
使用此代码:
Parameters p=camera.getParameters();
p.set("orientation", "portrait");
camera.setParameters(p);
并启动相机预览