* MoonlightTypeConverter.cs: Convert CacheMode's from strings.
[moon.git] / test / xaml / enums / fillrule-polygon.html
blobc4d1394e4cd13e316770e2b39ddf2d42d9d6edf4
1 <html>
2 <head>
3 <title>FillRule (Polygon) 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 <Polygon 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 <Polygon 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 <Polygon 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 <Polygon 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 <Polygon 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 <Polygon 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" />
17 </Canvas>
18 </script>
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;
38 </script>
39 </head>
41 <body>
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", {
47 width:'600px',
48 height:'300px',
49 inplaceInstallPrompt:false,
50 background:'#FFFFFF',
51 isWindowless:'false',
52 framerate:'24',
53 version:'1.0'
54 }, {
55 onError:null,
56 onLoad:null
58 null);
59 </script>
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].
70 </div>
71 </body>
72 </html>