Skip to content

Instantly share code, notes, and snippets.

View sharish's full-sized avatar

Harish Sridharan sharish

View GitHub Profile
int angle = 90; // your angle here
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
@Override
int leftOffset = 0; // your left offset in pixels
int topOffset = 0; // your top offset in pixels
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
int angle = 90; // your angle here
float scale = 0.5f; // scaling option for merging the image
Bitmap baseBitmap; // your base bitmap here
Bitmap mergeBitmap; // your merging bitmap here
ImageView imgView; // your image view for displaying the merged bitmaps.
BitmapMergerTask task = new BitmapMergerTask();
task.setBaseBitmap(baseBitmap)
.setMergeBitmap(mergeBitmap)
.setMergeListener(new BitmapMergerTask.OnMergeListener() {
@Override
language: android
jdk:
- oraclejdk7
- oraclejdk8
android:
components:
- build-tools-22.0.1
- android-22
- extra-android-support
- extra-android-m2repository
package com.cooltechworks.materialcolorshades;
import android.graphics.Color;
/**
* Created by sharish on 02/07/15.
*/
/**
package com.cooltechworks.ondownsample;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by sharish on 7/24/15.
*/
public abstract class OnDownListener implements View.OnTouchListener {
package com.cooltechworks.ondownsample;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
<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"
tools:context=".MainActivity">
<View
android:id="@+id/hello"
android:layout_width="150dp"
android:layout_height="150dp"
package com.cooltechworks.materialcolorshades;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="@color/blue_bg"
android:orientation="vertical">
<TextView
android:id="@+id/output_color_code"
android:layout_width="match_parent"