public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
camera.startPreview();
}
public void surfaceCreated(SurfaceHolder holder) {
camera = Camera.open();
try {
camera.setPreviewDisplay(holder);
Camera.Parameters parameters = camera.getParameters();
if (this.getResources().getConfiguration().orientation !=
Configuration.ORIENTATION_LANDSCAPE)
{
parameters.set("orientation", "portrait");
// Android 2.2和以上版本
camera.setDisplayOrientation(90);
// Android 2.0和以上版本
parameters.setRotation(90);
}
// 用于Android 2.0和更高版本的效果
List<String> colorEffects = parameters.
getSupportedColorEffects();
Iterator<String> cei = colorEffects.iterator();
while (cei.hasNext())
{