Skip to content

Instantly share code, notes, and snippets.

View msdx's full-sized avatar

浩码农 msdx

View GitHub Profile
@msdx
msdx / TakePhotoActivity.java
Created March 1, 2016 09:51
相机拍照代码
import android.app.Activity;
import android.content.Intent;
import android.graphics.ImageFormat;
import android.hardware.Camera;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
@msdx
msdx / ClipImage.java
Last active September 21, 2017 15:23
大图裁剪
package com.parkingwang.app.account.vehicle.takephoto;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapRegionDecoder;
import android.graphics.Matrix;
import android.graphics.Rect;
@msdx
msdx / CameraSize.java
Created January 8, 2016 05:47
set pictureSize and previewSize
private void openCamera() {
if (mCamera == null) {
try {
mCamera = Camera.open();
} catch (RuntimeException e) {
mCamera = null;
}
}
if (mCamera == null) {
MessageProxy.showError(this, R.string.msg_camera_invalid);
@msdx
msdx / TakePhoto.java
Last active January 8, 2016 03:24
Open camera.
private void openCamera() {
if (mCamera == null) {
try {
mCamera = Camera.open();
} catch (RuntimeException e) {
mCamera = null;
}
}
if (mCamera == null) {
MessageProxy.showError(this, R.string.msg_camera_invalid);