3
<title>FillRule (Polyline) Test Page</title>
5
<script language="javascript" src="Silverlight.js"></script>
7
<script type="text/xaml" id="xaml">
8
<Canvas x:Name="canvas" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" Loaded="onLoaded">
10
<Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,0,0" />
11
<Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,100,0" FillRule="EvenOdd" />
12
<Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,200,0" FillRule="Nonzero" />
14
<Polyline x:Name="testcase1" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,0,100" />
15
<Polyline x:Name="testcase2" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,100,100" />
16
<Polyline x:Name="testcase3" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,200,100" />
20
<script language="javascript">
21
function onLoaded (sender, args)
23
// invalid values defaults to EvenOdd (no value is EvenOdd)
24
sender.findName ("testcase1").FillRule = -1;
25
sender.findName ("testcase2").FillRule = 911;
27
sender.findName ("testcase3").FillRule = "nONzERO";
29
// Silverlight shows an Alert
30
// Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: FillRule
32
sender.findName ("testcase3").FillRule = "-1";
33
sender.findName ("testcase3").FillRule = sender.findName ("testcase2");
34
sender.findName ("testcase3").FillRule = null;
35
sender.findName ("testcase3").FillRule = true;
42
<div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
44
<script type="text/javascript">
45
var pe = document.getElementById("SilverlightPluginHost");
46
Silverlight.createObject("#xaml", pe, "AgControl1", {
49
inplaceInstallPrompt:false,
60
<div style="position:absolute; top:400px; left:50px">
61
<p>0,0 star center should be <b>white</b>
62
<br>1,0 star center should be <b>white</b>
63
<br>2,0 star center should be <b>black</b>
64
<p>0,1 should be identical to 0,1*
65
<br>1,1 should be identical to 1,1*
66
<br>2,1 should be identical to 2,1*
67
<p>* Note: this test fails (when the script part is used) on Silverlight. It does not paint anything and, if force (move a window
68
on top) often draws a black box over the second line. Browser (both FF and IE) start consuming large amount of memory .
69
Stepping with Firebug does show the 6 original images but does not show any update to the poly[gons|lines].