How to handle stickers with resize and rotate functionality? [closed]
Asked Answered
N

5

19

I am currently developing an application which will allow user to add stickers (hat, hairs, spectacles etc) on image. User can resize that sticker or can rotate that and move also. See image.

enter image description here

I have stickers, but how can I put them on original image and move/rotate/enlarge them to adjust on original image?

Nero answered 18/3, 2013 at 11:33 Comment(4)
I'm working on similar concept,can you tell me how did you add stickers ?Tumbledown
@MehulJoisar, I posted my answer my friend. I use that multi touch controller over my image. Then take screen shot of root layout. This will combine both image. :)Nero
Did you solve this problem?Ambulance
@MMakati, yes.. I did the above trick...Nero
N
10

I found a good result at http://code.google.com/p/android-multitouch-controller/. Which handles 3 in 1 facility. On Multi-Touch, you can pan your image, you can scale your image and at the same time you can also rotate your image. And you can add number of stickers as you want.

Nero answered 28/3, 2013 at 9:7 Comment(1)
I tried this library its working but when i add the second image then the first image is not focusable i.e. the previous image does not get rotate or touch. How to solve this problem.Warton
L
29

You can check the below link for stickerView

  1. https://github.com/nimengbo/StickerView
  2. https://github.com/kencheung4/android-StickerView
  3. https://github.com/uptechteam/MotionViews-Android
  4. https://github.com/wuapnjie/StickerView
  5. https://github.com/sangmingming/StickerView
  6. https://github.com/niravkalola/Android-StickerView
  7. https://github.com/Kaka252/StickerView
  8. https://github.com/yovenny/StickerView
Lepidolite answered 2/3, 2016 at 5:53 Comment(5)
Has anyone used this one? github.com/wuapnjie/StickerView It appears first on google searchTheriot
great. good job.Trawl
i upvote for github.com/uptechteam/MotionViews-Android . I think it is the most mature from that listFrei
@Donato me.....Cotton
@Donato I even added my own changes to help zooming in/out the sticker in case of small size stickers, you will find my forked reppository here github.com/MuhammedRefaat/StickerViewCotton
N
10

I found a good result at http://code.google.com/p/android-multitouch-controller/. Which handles 3 in 1 facility. On Multi-Touch, you can pan your image, you can scale your image and at the same time you can also rotate your image. And you can add number of stickers as you want.

Nero answered 28/3, 2013 at 9:7 Comment(1)
I tried this library its working but when i add the second image then the first image is not focusable i.e. the previous image does not get rotate or touch. How to solve this problem.Warton
L
1

To enlarge/reduce an image, you can try the following code:

yourImageView.setLayoutParams(new GridView.LayoutParams(newWidthImage, newHeightImage));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

Hope this help.

Lilliamlillian answered 18/3, 2013 at 11:43 Comment(2)
but how can i move that image on imageview(original image holder)?Nero
Take a look to this post #10834957Lilliamlillian
R
1

First step : Download this link Lib. https://github.com/nimengbo/StickerView

Second : (StickerView,BubblePropertyModel,StickerPropertryModel.java in this three file paste your project).

Third step : Below Code Past your MainActivity File:

Note: mainlayout is (Relativelayout object)

 final StickerView stickerView21 = new StickerView(this);
            stickerView21.setImageResource(R.drawable.fall_9);

            stickerView21.setOperationListener(new  StickerView.OperationListener() {
                @Override
                public void onDeleteClick() {
                    mViews.remove(stickerView21);
                    mainLayout.removeView(stickerView21);
                }

                @Override
                public void onEdit(StickerView stickerView)
                {

                }

                @Override
                public void onTop(StickerView stickerView) {
                    int position = mViews.indexOf(stickerView);
                    if (position == mViews.size() - 1) {
                        return;
                    }
                    StickerView stickerTemp = (StickerView) mViews.remove(position);

                    mViews.add(mViews.size(), stickerTemp);
                }
            });


            RelativeLayout.LayoutParams l11= new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
            mainLayout.addView(stickerView21, l11);
            mViews.add(stickerView21);
Ruble answered 3/8, 2017 at 4:40 Comment(0)
S
0

Check out the blogspot they tried to implement the functionality of stretch the image on arrow click and also delete it, and also you can move the image on the screen using gesture.

Drag-Drop image Also check out the Demo of DragDropImage

You can also download the source code which is mentioned in blog.

https://mcmap.net/q/665993/-android-rotate-image-with-single-finger-gesture

Stairs answered 7/4, 2014 at 10:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.