Skip to content

Instantly share code, notes, and snippets.

浩码农 msdx

Block or report user

Report or block msdx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TakePhotoActivity.java
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 Sep 21, 2017
大图裁剪
View ClipImage.java
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 Jan 8, 2016
set pictureSize and previewSize
View CameraSize.java
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 Jan 8, 2016
Open camera.
View TakePhoto.java
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);
You can’t perform that action at this time.