<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> window.onload = function () { // get the canvas DOM element by its ID var canvas = document.getElementById("c"); var context = canvas.getContext("2d"); context.lineWidth =2; context.strokeStyle = "blue"; context.moveTo(0,0); context.lineTo(400,200); context.stroke(); }; </script> </head> <body> <form id="form1" runat="server"> <div> <canvas style=" border:2px solid red; width:500px; height:500px;" id="c"></canvas> </div> </form> </body> </html>
<!DOCTYPE html> <html> <body> <script type="text/javascript"> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.moveTo(10,10); ctx.lineTo(150,50); ctx.lineTo(10,50); ctx.stroke(); </script> </body> </html>
<canvas style=" border:thin solid red; width:500px; height:500px;" id="c"></canvas>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)