Canvas does the on-screen comment effect. How to traverse the profile picture into it?

requirements: traverse the passed array objects in the form of on-screen comments.
looked around on the Internet, some of them traversed text,color, but did not see canvas traversing avatars. DrawImage can only operate on img tags, right? It doesn"t seem to work either

Mar.11,2022

to answer by myself, I just contacted canvas, and searched the Internet for a long circle. The final answer is as follows:

//
var textArr = [
    {img:'img/btn_collection.png',msg:'ceshi shak bjv sjdk '},
    {img:'img/btn_complete.png',msg:'ceshi shak bjv sjdk '},
    {img:'img/btn_didnt_confirm.png',msg:'ceshi shak bjv sjdk '},
    {img:'img/btn_dingdanxiaox.png',msg:'ceshi shak bjv sjdk '},
]

take this sentence when traversing:

var img = new Image();
img.src = textArr[j].img;
ctx.drawImage(img, 0, 0, 50,50,numArrL[j]-30,numArrT[j]-40,50,50);

simple effect:

Menu