Canvas2 노마드코더 JS로 그림 앱 만들기 - 마지막 Meme Maker 구현하기 파일을 선택하는 인풋은 type 을 file 로, 여기선 영상은 필요하지 않으므로 accept 속성에 image/* 를 설정하여 이미지 포맷만 가능하게 지정한다. // 파일 받기 function onFileChange(evt) { console.dir(evt.target); } fileInput.addEventListener('change', onFileChange); 파일을 선택하고 콘솔을 확인하면, target의 files 에 내가 넣어준 이미지가 존재함을 볼 수 있다. 이 파일은 이제 브라우저의 메모리에 존재하게 되고 브라우저의 url 을 받아오면 해당 이미지를 볼 수 있게 된다. // 파일 받기 function onFileChange(evt) { const file =.. 2023. 6. 10. 노마드코더 JS로 그림 앱 만들기 - 1 초기 설정 // index.html app.js / index.html / styles.css 파일 생성 live sever 확장 프로그램 설치 ❗️ canvas 란? https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API Canvas API - Web APIs | MDN The Canvas API provides a means for drawing graphics via JavaScript and the HTML element. Among other things, it can be used for animation, game graphics, data visualization, photo manipulation, and real-time video p.. 2023. 6. 8. 이전 1 다음