Created
July 25, 2015 04:30
-
-
Save sharish/d1f7da17d09853bea300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | |
@Override | |
public void onMerge(BitmapMergerTask task, Bitmap mergedBitmap) { | |
if(imgView != null) { | |
imgView.setImageBitmap(mergedBitmap); | |
} | |
} | |
}) | |
.setScale(scale) | |
.setOffsets(leftOffset,topOffset) | |
.merge(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment