The problem of triangular picture background in CSS chat bubble

clipboard.png

as shown in the picture, many chat bubbles have a small triangle pointing to the avatar. If it is a text bubble, you can use a small triangle of the same color as the chat bubble. But what about the picture? How to fill this small triangle with the background of the picture? It can be seen that the column of the small triangle is covered, revealing only the picture in the small triangle.

Apr.01,2021

take Wechat as an example. From what I know so far, only sharing, Mini Program sharing and text will have a triangle pointing to users, and there are no pictures sent by themselves.


you can use the getImageData method in canvas to get the background color of the image boundary, and then fill the small triangle


https://jsfiddle.net/5gstomnq.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b387be-2b895.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b387be-2b895.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?