| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>Testing pattern</title> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<style type="text/css"> |
| 7 |
@import "../../../dojo/resources/dojo.css"; |
| 8 |
@import "../../../dijit/tests/css/dijitTests.css"; |
| 9 |
</style> |
| 10 |
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script> |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
<script type="text/javascript"> |
| 17 |
dojo.require("dojox.gfx"); |
| 18 |
|
| 19 |
createSurface = function(){ |
| 20 |
var surface = dojox.gfx.createSurface("test", 800, 600); |
| 21 |
surface.whenLoaded(makeShapes); |
| 22 |
}; |
| 23 |
|
| 24 |
makeShapes = function(surface){ |
| 25 |
var pattern = { |
| 26 |
type: "pattern", |
| 27 |
x: 30, y: 20, width: 75, height: 60, |
| 28 |
src: "images/eugene-sm.jpg" |
| 29 |
}; |
| 30 |
var ellipse = {cx: 400, cy: 200, rx: 350, ry: 150}; |
| 31 |
surface.createEllipse(ellipse) |
| 32 |
.setStroke({color: "blue", width: 1 }) |
| 33 |
.setFill(pattern); |
| 34 |
}; |
| 35 |
|
| 36 |
dojo.addOnLoad(createSurface); |
| 37 |
|
| 38 |
</script> |
| 39 |
</head> |
| 40 |
<body> |
| 41 |
<h1>dojox.gfx Pattern test</h1> |
| 42 |
<div id="test"></div> |
| 43 |
<p>That's all Folks!</p> |
| 44 |
</body> |
| 45 |
</html> |