0

lets say I want to make an app which lets user create avatar from choice of clothes/items and then let other users see these "avatars". So what would be the best way to make this work? I was thinking of having these clothes/items as images, then save user avatars as numbers say: 4f6v31 which would translate into like:

4 = skin color.
f = face.
6 = shirt color.
v = pants color.
3 = shoes.
1 = hair.

Then when user receives say 5 of these "other peoples saved avatars" it would load all 5 avatars by combining those clothes/items images into one drawable. Is such thing possible or is there better way?

1 Answer 1

1

Create a new Bitmap Canvas of the appropriate size and then follow these steps:

  1. Load the lowest Drawable layer as a Bitmap
  2. Create a PorterDuffColorFilter with the user's selected color
  3. Paint the Bitmap to the output Canvas using the filter
  4. Repeat for the next lowest layer

Once every layer has been painted to the canvas, write it out to a BitmapDrawable and apply to an ImageView.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.