캔버스에 이미지를 그린 다음 sketch.js로 이미지를 스케치 할 수 있습니다. 지금 상황은 다음과 같습니다캔버스에 이미지와 스케치를 함께 그리는 방법
1.the image has been drawn on the canvas successfully
2. but when my mouse over the canvas, then image disappeared, and the canvas shows empty
3. when I dragged the mouse, some sketch shows on the empty canvas(the sketch looks correct)
그래서, 나는 두 함수를 잘했습니다,하지만 난 사이에있는 부분에 대한 혼란 스러워요. 캔버스에 이미지가있는 스케치를 그릴 수 있기를 바랍니다.
index.html을 :
<canvas id="mysketch" width="578" height="400" style="margin: 0px; "></canvas>
canvas.js : 여기 내 코드입니다
var mysketch = jQuery("#mysketch");
// draw the captured image to canvas
var displayImage = function() {
var context = mysketch.get(0).getContext("2d");
var image = new Image();
image.onload = function() {
context.drawImage(image, 0, 0);
}
// prepend the required image info again
image.src = dataURL;
// call sketch.js to draw sketch on the canvas
mysketch.sketch({defaultColor: "#ff0"});
}
'hover'이벤트에 대한 일부 CSS 또는 다른 기능이 없습니까? 덕분에 – Hank