Skip to content

Instantly share code, notes, and snippets.

View javikin's full-sized avatar

Javier Olan javikin

View GitHub Profile
/**
* Crop a image taking a recerence a view parent like a frame, and a view child like final
* reference
*
* @param bitmap image to crop
* @param frame where the image is set it
* @param reference frame to take reference for crop the image
* @return image already cropped
*/
public static byte[] cropImage(Bitmap bitmap, View frame, View reference){
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/textureView"
android:background="@color/white"