~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to test/xaml/enums/alignmenty-videobrush.html

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
  <head>
 
3
      <title>AlignmentY (VideoBrush) Test Page</title>
 
4
 
 
5
      <script language="javascript" src="Silverlight.js"></script>
 
6
 
 
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">
 
9
 
 
10
                <MediaElement x:Name="ExampleVideo" Source="../../media/video/timecode-short-wmv8.wmv" Opacity="0.0" IsHitTestVisible="False" />
 
11
 
 
12
                <Rectangle Canvas.Left="20" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
 
13
                <Rectangle.Fill>
 
14
                        <VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Top" />
 
15
                </Rectangle.Fill>
 
16
                </Rectangle> 
 
17
                <Rectangle Canvas.Left="120" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
 
18
                <Rectangle.Fill>
 
19
                        <VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Center" />
 
20
                </Rectangle.Fill>
 
21
                </Rectangle> 
 
22
                <Rectangle Canvas.Left="220" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
 
23
                <Rectangle.Fill>
 
24
                        <VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Bottom" />
 
25
                </Rectangle.Fill>
 
26
                </Rectangle>
 
27
 
 
28
                <Rectangle Canvas.Left="20" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
29
                <Rectangle.Fill>
 
30
                        <VideoBrush x:Name="testcase1" SourceName="ExampleVideo" Stretch="None" />
 
31
                </Rectangle.Fill>
 
32
                </Rectangle> 
 
33
                <Rectangle Canvas.Left="120" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
34
                <Rectangle.Fill>
 
35
                        <VideoBrush x:Name="testcase2" SourceName="ExampleVideo" Stretch="None" />
 
36
                </Rectangle.Fill>
 
37
                </Rectangle> 
 
38
                <Rectangle Canvas.Left="220" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
39
                <Rectangle.Fill>
 
40
                        <VideoBrush x:Name="testcase3" SourceName="ExampleVideo" Stretch="None" />
 
41
                </Rectangle.Fill>
 
42
                </Rectangle>
 
43
        </Canvas>
 
44
      </script>
 
45
 
 
46
      <script language="javascript">
 
47
function onLoaded (sender, args)
 
48
{
 
49
        // invalid values defaults to BOTTOM (no value is CENTER)
 
50
        sender.findName ("testcase1").AlignmentY = -1;
 
51
        sender.findName ("testcase2").AlignmentY = 911;
 
52
 
 
53
        sender.findName ("testcase3").AlignmentY = "tOp";
 
54
 
 
55
        // Silverlight shows an Alert
 
56
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: AlignmentY
 
57
/*
 
58
        sender.findName ("testcase3").AlignmentY = "-1";
 
59
        sender.findName ("testcase3").AlignmentY = sender.findName ("testcase2");
 
60
        sender.findName ("testcase3").AlignmentY = null;
 
61
        sender.findName ("testcase3").AlignmentY = true;
 
62
*/
 
63
}
 
64
      </script>
 
65
  </head>
 
66
 
 
67
  <body>
 
68
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
69
 
 
70
  <script type="text/javascript">
 
71
        var pe = document.getElementById("SilverlightPluginHost");
 
72
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
73
                        width:'600px',
 
74
                        height:'300px',
 
75
                        inplaceInstallPrompt:false,
 
76
                        background:'#FFFFFF',
 
77
                        isWindowless:'false',
 
78
                        framerate:'24',
 
79
                        version:'1.0'
 
80
                }, {
 
81
                        onError:null,
 
82
                        onLoad:null
 
83
                },
 
84
                null);
 
85
  </script>
 
86
  <div style="position:absolute; top:400px; left:50px">
 
87
<p>0,0 should be completely <b>black</b>
 
88
<br>1,0 should be the center of <b>0:0</b>
 
89
<br>2,0 should be completely <b>black</b>
 
90
<p>0,1 should be completely <b>black</b>
 
91
<br>1,1 should be completely <b>black</b>
 
92
<br>2,1 should be completely <b>black</b>
 
93
  </div>
 
94
  </body>
 
95
</html>