• Stars
    star
    340
  • Rank 124,317 (Top 3 %)
  • Language
    Java
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

image cropping layout

Image Cropping Layout

badge

A light-weight image cropping layout, allowing UI customization and cropping box update listener. Image and the selected area (cropping box) is scale and fit into the predefined area. In the latest release, multiple boxes are supported.

Current Version: 1.1.5

image-crop

Import

dependencies {
    compile 'me.littlecheesecake:croplayout:1.1.5'
    ...
}

Usage

final EditPhotoView imageView = (EditPhotoView) findViewById(R.id.editable_image);
final EditableImage image = new EditableImage(this, R.drawable.photo2);

ScalableBox box1 = new ScalableBox(25,180,640,880);
ScalableBox box2 = new ScalableBox(2,18,680,880);
ScalableBox box3 =  new ScalableBox(250,80,400,880);
List<ScalableBox> boxes = new ArrayList<>();
boxes.add(box1);
boxes.add(box2);
boxes.add(box3);
image.setBoxes(boxes);
imageView.initView(this, image);

imageView.setOnBoxChangedListener(new OnBoxChangedListener() {
    @Override
    public void onChanged(int x1, int y1, int x2, int y2) {
        boxText.setText("box: [" + x1 + "," + y1 +"],[" + x2 + "," + y2 + "]");
    }
});

UI Customization

<me.littlecheesecake.croplayout.EditPhotoView
    android:id="@+id/editable_image"
    android:layout_width="300dp"
    android:layout_height="200dp"
    android:layout_margin="20dp"
    android:background="#fff"
    crop:crop_corner_color="#45B4CA"
    crop:crop_line_color="#d7af55"
    crop:crop_dot_color="#333333"
    crop:crop_shadow_color="#77ffffff"/>

image_attr

Known Issue

  • actual cropping of the image is not implemented, but only update the selected area (cropping box)
  • crop box will be reset to the full image after rotation
  • image zoom-in is not supported

Developed By

Yu Lu @littlecheesecake.me

License

Copyright 2016 Yu Lu

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.

More Repositories

1

Instagram_Filter

Use Shaders to mimic some Instagram filter effect.
Java
342
star
2

ShaderFilter

A demo Android app, shader-based image processing
Java
150
star
3

GLtext

Android Project: OpenGL ES shaders for simple image processing
Java
128
star
4

ShaderCam

Demo app to discuss rendering camera frame using OpenGL ES
Java
126
star
5

DaggerSample

A collection and exploration on Dependency Injection on Android using Dagger 2 (google version)
Java
14
star
6

GLTexture

Live streaming of camera with OpenGL ES Shaders
Java
13
star
7

SocialShare

A sample for sharing photo on Facebook and Weibo within a third-party app
Java
5
star
8

yulu.github.io

Blog host on github
SCSS
4
star
9

Watershed

a demo to use watershed algorithm to do image processing, based on opencv
C++
4
star
10

desc_compare

Using openCV, compare different types of descriptors
C++
3
star
11

GestureCam

This is an Demo Android App to explore the gesture control of the camera view: flip to switch between front/back, upside down and zoom in/out
Java
3
star
12

wedding

wedding site
HTML
2
star
13

python_cv

Python. Explore opencv, vlfeat library in python
Python
2
star
14

algorithm

Review of Algorithms
Java
2
star
15

VideoPhoneAR

Java
1
star
16

TextPhoneAR

Java
1
star
17

CamHttpTest

A test app for uploading camera frames
Java
1
star
18

Poster

Java
1
star
19

UILibrary

Java
1
star
20

FragmentSample

This is a learning example to explore the fragments in Android
Java
1
star
21

SessionManager

Test program to manage user session and log in activity
Java
1
star
22

GLShaderFilter

A test for shader filter API
Java
1
star
23

Design_Patterns

All the codes related to learning design patterns
Python
1
star
24

qr-code-scanner

Java
1
star