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

« back to all changes in this revision

Viewing changes to test/xaml/enums/stretch-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>Stretch (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" />
 
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="Fill" />
 
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="Uniform" />
 
25
                </Rectangle.Fill>
 
26
                </Rectangle>
 
27
                <Rectangle Canvas.Left="320" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
 
28
                <Rectangle.Fill>
 
29
                        <VideoBrush SourceName="ExampleVideo" Stretch="UniformToFill" />
 
30
                </Rectangle.Fill>
 
31
                </Rectangle>
 
32
 
 
33
                <Rectangle Canvas.Left="20" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
34
                <Rectangle.Fill>
 
35
                        <VideoBrush x:Name="testcase1" SourceName="ExampleVideo" />
 
36
                </Rectangle.Fill>
 
37
                </Rectangle> 
 
38
                <Rectangle Canvas.Left="120" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
39
                <Rectangle.Fill>
 
40
                        <VideoBrush x:Name="testcase2" SourceName="ExampleVideo" />
 
41
                </Rectangle.Fill>
 
42
                </Rectangle> 
 
43
                <Rectangle Canvas.Left="220" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
44
                <Rectangle.Fill>
 
45
                        <VideoBrush x:Name="testcase3" SourceName="ExampleVideo" />
 
46
                </Rectangle.Fill>
 
47
                </Rectangle>
 
48
                <Rectangle Canvas.Left="320" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
 
49
                <Rectangle.Fill>
 
50
                        <VideoBrush x:Name="testcase4" SourceName="ExampleVideo" />
 
51
                </Rectangle.Fill>
 
52
                </Rectangle>
 
53
        </Canvas>
 
54
      </script>
 
55
 
 
56
      <script language="javascript">
 
57
function onLoaded (sender, args)
 
58
{
 
59
        // invalid values defaults to *an empty image* (no value is FILL)
 
60
        sender.findName ("testcase1").Stretch = -1;
 
61
        sender.findName ("testcase2").Stretch = 911;
 
62
 
 
63
        sender.findName ("testcase3").Stretch = "nOnE";
 
64
        sender.findName ("testcase4").Stretch = "uNIFORMtOfILL";
 
65
 
 
66
        // Silverlight shows an Alert
 
67
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: Stretch
 
68
/*
 
69
        sender.findName ("testcase3").Stretch = "";
 
70
*/
 
71
}
 
72
      </script>
 
73
  </head>
 
74
 
 
75
  <body>
 
76
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
77
 
 
78
  <script type="text/javascript">
 
79
        var pe = document.getElementById("SilverlightPluginHost");
 
80
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
81
                        width:'600px',
 
82
                        height:'300px',
 
83
                        inplaceInstallPrompt:false,
 
84
                        background:'#FFFFFF',
 
85
                        isWindowless:'false',
 
86
                        framerate:'24',
 
87
                        version:'1.0'
 
88
                }, {
 
89
                        onError:null,
 
90
                        onLoad:null
 
91
                },
 
92
                null);
 
93
  </script>
 
94
  <div style="position:absolute; top:400px; left:50px">
 
95
<p>0,0 should be the center of <b>0:0</b> (None)
 
96
<br>1,0 should be <b>+00:00:02:00</b> when video ends
 
97
<br>2,0 should be <b>+00:00:02:00</b> with white bands on top/bottom when video ends
 
98
<br>3,0 should be the center part of <b>0:00:02:0</b> when video ends
 
99
<p>0,1 should be <b>empty</b> (no video image, not even the rectangle border)
 
100
<br>1,1 should be <b>empty</b> (no video image, not even the rectangle border)
 
101
<br>2,1 should be the center of <b>0:0</b> (like 0,0)
 
102
<br>3,1 should be the center part of <b>0:00:02:0</b> when video ends (like 3,0)
 
103
  </div>
 
104
  </body>
 
105
</html>