list (124) 썸네일형 리스트형 html javascript - canvas to png, jpg file function savePng(canvas, name) { saveImage(canvas.toDataURL('image/png'), name, 'png')}function saveJpg(canvas, name) { saveImage(canvas.toDataURL('image/jpg'), name, 'jpg')}function saveImage(dataUrl, name, type) { const link = document.createElement('a') link.href = dataUrl link.download = `${name}.${type}` link.click() URL.revokeObjectURL(link.href)} html javascript - canvas imageData const canvas = document.createElement('canvas')canvas.width = 200canvas.height = 200document.body.appendChild(canvas)const ctx = canvas.getContext('2d')const imgData = ctx.createImageData(100, 100)for (let i=0; i html javascript - array, object copy const obj = {name: 'obj'}const list = [obj]const obj1 = structuredClone(obj)obj1.name = 'obj 1'const list1 = structuredClone(list)list1[0].name = 'list 1 obj'const obj2 = Object.create(obj)obj2.name = 'obj 2'const list2 = Array.from(Object.create(list))list2[0].name = 'list 2 obj'console.log(list1[0] === obj) // falseconsole.log(list2[0] === obj) // trueconsole.log(obj) // { name: 'list 2 obj' }.. html javascript - easing circular html javascript - easing exponential html javascript - easing sinusoidal html javascript - easing quintic html javascript - easing quartic 이전 1 2 3 4 5 ··· 16 다음