2011年12月31日土曜日

PictureSize and format

Change picture format and size at Camera Class
get current picture format .
Camera.Parameters param = camera.getParameters();
Log.d("camera", "format= " + param.getPictureFormat ());
get supported picture format list.
Camera.Parameters param = camera.getParameters();
List pictureformatlist = param.getSupportedPictureFormats ();
for (int i=0;i < pictureformatlist.size();i++) {
 Log.d("camera", "format " + i + " = " + pictureformatlist.get(i));
}
NexusOne is suppoerted 256(JPEG) only.
get current picture size.
//get
Camera.Parameters param = camera.getParameters();
//get picture size
Log.d("camera", "width= " + param.getPictureSize ().width + " height= " + param.getPictureSize ().height);
get supported picture size list.
Camera.Parameters param = camera.getParameters();
List picturesizelist = param.getSupportedPictureSizes ();
for (int i=0;i < picturesizelist.size();i++) {
 Log.d("camera", i + " width = " + picturesizelist.get(i).width + " height = "  + picturesizelist.get(i).height);
}
NexusOne is supported list:
width = 2592 height = 1944
width = 2048 height = 1536
width = 1600 height = 1200
width = 1024 height = 768
width = 512 height = 384
set picture size. change taken picture image size.
Camera.Parameters param = camera.getParameters();
param.setPictureSize(2048, 1536);
camera.setParameters(param);

source code is here.

0 件のコメント:

コメントを投稿