2012-12-03 204 views

回答

1

創建一個JavaScript方法,即繪製多邊形,並與來自Asp.Net側註冊它Register methods

function DrawPolygon() 
{ 
    var context = canvas.getContext('2d'); 
    context.fillStyle = '#f00'; 
    context.beginPath(); 
    context.moveTo(0, 0); 
    context.lineTo(100,100); 
    context.lineTo(50, 100); 
    context.lineTo(10, 10); 
    context.closePath(); 
    context.fill(); 
}