uptechteam / MotionViews-Android

Code Guide: How to create Snapchat-like image stickers and text stickers.
https://blog.uptech.team/how-to-create-snapchat-like-stickers-for-android-50512957c351
MIT License
479 stars 112 forks source link

How to set backgound image? #29

Closed tushar091 closed 6 years ago

tushar091 commented 6 years ago

I want to set background image upon which to add stickers

chacha13 commented 6 years ago

just add setBackgroundResource to the MotionView

dhirensengar commented 6 years ago

how to set Gallery image in MotionView as Background. Plz help me

dhirensengar commented 6 years ago

I have done in this way to set MotionView background, but while saving image , its background doesn`t comes only selected sticker and Text are visible.

File f = new File(getRealPathFromURI(Uri.parse(PicUri))); Drawable d = Drawable.createFromPath(f.getAbsolutePath()); motionView.setBackground(d);

jayarajm commented 6 years ago

The image getting stretch when I set background. How can I set background image with aspectToFit?

jayarajm commented 6 years ago

I done with some customisation. Make normal motion entity and set non editable it is working good.

AndriyBas commented 6 years ago

@jayarajm or you can just add another view (ex: ImageView) behind the MotionView and set it's params to whatever you want.

JayarajTrans commented 6 years ago

Thank you @AndriyBas

NareshAskani commented 5 years ago

I done with some customisation. Make normal motion entity and set non editable it is working good.

hi, could you help with code, i am also tried in same process. but i am not able to figure out holyscale value. images not able to fit with in screen.