Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to a MediaElement that has properties (like ME2 in Grid.Row=1 ). It should be (Stretch="Uniform" StretchDirection="Both" )

I also want to rotate the MediaElement 45 angle on y axis with center value for x axis 1. (like ME1 in Grid.Row=0 )

Following XAML realizes two of them for 2 different MediaElement. But I want to realize two of them for a MediaElement. But rotated MediaElement does not stretch. How can I do that?
XML
<Window
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     x:Class="WpfApplication2.Window2"
     x:Name="Window"
     Title="Window2"
     Width="640" Height="480">
     <Grid Background="Aqua" ShowGridLines="True">
          <Grid.RowDefinitions>
               <RowDefinition Height="1*"/>
               <RowDefinition Height="1*"/>
          </Grid.RowDefinitions>
          <Viewport3D>
               <Viewport3D.Camera>
                    <PerspectiveCamera Position="0, 0, 8" >
                         <PerspectiveCamera.Transform>
                              <Transform3DGroup>
                                   <TranslateTransform3D OffsetX="-1" OffsetY="0" OffsetZ="0"/>
                                   <RotateTransform3D >
                                        <RotateTransform3D.Rotation>
                                             <AxisAngleRotation3D Angle="45" Axis="0,1,0"/>
                                        </RotateTransform3D.Rotation>
                                   </RotateTransform3D>
                                   <TranslateTransform3D OffsetX="1" OffsetY="0" OffsetZ="0"/>
                              </Transform3DGroup>
                         </PerspectiveCamera.Transform>
                    </PerspectiveCamera>
               </Viewport3D.Camera>
               <Viewport2DVisual3D>
                    <Viewport2DVisual3D.Transform>
                         <RotateTransform3D>
                              <RotateTransform3D.Rotation>
                                   <AxisAngleRotation3D Angle="0" Axis="0, 1, 0" />
                              </RotateTransform3D.Rotation>
                         </RotateTransform3D>
                    </Viewport2DVisual3D.Transform>
                    <Viewport2DVisual3D.Geometry>
                         <MeshGeometry3D 
                              Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
                              TextureCoordinates="0,0 0,1 1,1 1,0" 
                              TriangleIndices="0 1 2 0 2 3"/>
                    </Viewport2DVisual3D.Geometry>
                    <Viewport2DVisual3D.Material>
                         <DiffuseMaterial 
                              Viewport2DVisual3D.IsVisualHostMaterial="True" 
                              Brush="White"/>
                    </Viewport2DVisual3D.Material>
                    <MediaElement Name="ME1"
                         Grid.Row="1"
                         Stretch="Uniform" 
                         StretchDirection="Both" 
                         Source="D:\Yasir\Multimedya\Videos\Six demiyen çocuk.flv"/>
               </Viewport2DVisual3D>
               <ModelVisual3D>
                    <ModelVisual3D.Content>
                         <DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/>
                    </ModelVisual3D.Content>
               </ModelVisual3D>
          </Viewport3D>
            <MediaElement Name="ME2"
                    Grid.Row="1"
                    Stretch="Uniform" 
                    StretchDirection="Both" 
                    Source="D:\Yasir\Multimedya\Videos\Six demiyen çocuk.flv"/>
      </Grid>
</Window>


I benefit from here to make my sample..

Thanks advance. Please help me
Posted
Updated 3-Feb-10 7:52am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900