Home  >  Q&A  >  body text

Algorithm - How to implement QQ multi-person chat avatar in Java

As shown in the figure
1: Please note that pictures cannot be superimposed on each other
2: It is best to use a universal algorithm, and the x and y positions are best not to be hard-coded
3: It is best to be universal N pictures

I tried drawing curves to intercept but failed. The amount of calculation seemed a bit large, or my idea was wrong. I hope the master can provide an algorithm that is simple, easy to understand and maintainable.

高洛峰高洛峰2713 days ago512

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-17 09:59:55

    1. Picture processing, take a circular area and add strokes;

    2. Sort pictures, arrange them clockwise or counterclockwise according to the center of the circle;

    3. Calculate the overlapping area;

    4. Image merging, decide which image to use in the overlapping area according to the serial number.

    reply
    0
  • Cancelreply