resoCamera.apk Function:
- you can set preview size 16:9 or 4:3
- Flash Control
- Touch Focus
- Front and rear camera toggle
- Two-finger zoom control camera preview
- After taking a picture of the filter(Based on GPUImage)
- Flash Mode : FLASH_AUTO (
default
),FLASH_OPEN,FLASH_CLOSE; - Camera Preview Proportion : MODE4T3(
default
),MODE16T9;
mCamera.changeFlash();
mCamera.changeCamera();
mCamera.takePicture();
public interface OnCameraSelectListener {
public void onTakePicture(boolean success, String filePath);
public void onChangeFlashMode(int flashMode);
public void onChangeCameraPosition(int camera_position);
}
- Enhance the speed camera
- you can set picture quality now (1-100)
- fix bug - take picture orientation
repositories {
// ...
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.ValuesFeng:ResoCamera:0.1'
}
<manifest>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
<activity android:screenOrientation="portrait"/>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
try {
cameraView = new CameraView(this);
cameraView.setFocusView((FocusView) findViewById(R.id.sf_focus));
/**
* setCameraView(SurfaceView surfaceView, int screenWidth, int cameraMode)
*/
// cameraView.setCameraView((SurfaceView) findViewById(R.id.sf_camera));
cameraView.setCameraView((SurfaceView) findViewById(R.id.sf_camera),CameraView.MODE4T3);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
cameraView.onResume();//must
}else{
cameraView.onPause();
}
}
//@Override
//protected void onPause() {
// super.onPause();
// if (cameraView != null)
// cameraView.onPause(); //must
//}
Copyright 2011-2014 valuesFeng
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.