Play with bitmaps

Min SDK   9
Latest Commit   2015-08-07 13:41:32
License   MIT

Github   https://github.com/sharish/BitmapMerger

         

标签

使用APP客户端扫描二维码运行Demo


...

sharish

Chennai, India


         

类似的还有....
SImageView a final circle group imageView. 集成qq微信群组头像, url直接显示等
AnchorImageView 课本点读Demo [An ImageView that anchors points according to the pixels, locates the anchored area.]
cropiwa
README

README.md

Android Arsenal Travis CI

BitmapMerger

Bitmap Merger is a simple project help you to merge two bitmaps without memory exceptions. The bitmaps are processed in background threads thereby taking the load away from UI thread. Along with merge, it also contains the image decoder for decoding images from resources/disk and are sampled to prevent OutOfMemoryError.

Examples of Bitmap Merger with this project

Merging at angle away Merging at center Merging with offsets
merge_angle_small merge_at_center_small merge_offset_small
Moon moving around the earth for various angles Stamp at center of the document being scaled Balloon flying in a beach with various offset values

###Usage :

####Merging at angle away

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
                        public void onMerge(BitmapMergerTask task, Bitmap mergedBitmap) {
                            if(imgView != null) {
                              imgView.setImageBitmap(mergedBitmap);
                            }
                        }
                    })
                    .setScale(scale)
                    .setAngle(angle)
                    .merge();

####Merging at center

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)
                    .merge();

####Merging with offsets from top left

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();

Developed By