Form
context.drawWindow(object,x1,y1,x2,y2,color)
Parameters
parameter |
description |
x1 |
specifies the X1 coordinate |
y1 |
specifies the Y1 coordinate |
x2 |
specifies the X2 coordinate |
y2 |
specifies the Y2 coordinate |
color |
specifies the color. specify like "rgb(red brightness, green brightness, blue brightness)" |
Explanation
The drawWindow draws a specified area displayed on the window into a canvas. This method doesn't work on the Web for security reasons. But you may display it on the sidebar, etc.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<script type="text/javascript"><!--
function drawPoint()
{
canvasObj = document.getElementById("imgCanvas");
conObj = canvasObj.getContext("2d");
conObj.drawWindow(window, 0, 0, 400, 400, "rgb(0,0,0)");
}
// --></script> </head>
<body onload="drawPoint()">
<h1>Sample</h1>
<canvas id="imgCanvas" width="320" height="240" style="border:1px black solid"></canvas>
</body>
</html>