블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
반응형

Category

Recent Post

Recent Comment

Archive

2009. 11. 27. 12:28 .Net Project/SilverLight 3.0
반응형
  3D Perspective
- 실버라이트3에 새롭게 추가된 기능
- Full 3D가 아닌 2D객체를 3D 공간에 배치하여 마치 3D 객체인 것처럼 보이게 하는 기능입니다
- 일반적인 3D에서는 객체를 두고 카메라의 위치를 변경 하지만,
   Perspective 3D 에서는 객체를 회전하여 3D효과를 나타냅니다
- Rotation(X,Y,Z) 프로퍼티  : 회전 각도 설정
- CenterOfRotation(X,Y,Z) 프로퍼티 : 방향의 회전축 설정
- GlobalOffset(X,Y,Z) 프로퍼티 : 중심 객체 이동
-LocalOffset(X,Y,Z) 프로퍼티 : 중심 객체 이동

 

 Perspective.Xaml

<UserControl x:Class="PlaneProjectionExample.MainPage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">

    <StackPanel x:Name="LayoutRoot"
                 
 Width="600" Height="400"
                  
 Background="White" Orientation="Vertical">

        <StackPanel Width="300" Height="200"
                  
 Orientation="Vertical"
                  
 Background="Orange" Margin="0,50,0,0">

            <StackPanel.Projection>

                <!-- PlaneProjection 프로퍼티 -->

                <PlaneProjection x:Name="planeProjection" />

            </StackPanel.Projection>

 

            <TextBlock Text="PlaneProject Example" />

            <TextBlock Text="Input Text" />

            <Button Content="버튼" />

            <Ellipse Width="50" Height="50" Fill="Blue"/>

 

        </StackPanel>

 

        <!-- 카테고리 -->

        <StackPanel Orientation="Horizontal" Margin="0,50,0,0">

            <TextBlock Text="Category" Width="150" TextAlignment="Center"/>

            <TextBlock Text="X" Width="150" TextAlignment="Center"/>

            <TextBlock Text="Y" Width="150" TextAlignment="Center"/>

            <TextBlock Text="Z" Width="150" TextAlignment="Center"/>

        </StackPanel>

 

        <!-- Rotation 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="Rotation" Width="150" TextAlignment="Center"/>

            <!-- Rotation(X, Y, Z) 프로퍼티 데이터 바인딩 -->

            <Slider x:Name="RotationX" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationX,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="RotationY" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationY,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="RotationZ" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationZ,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- CenterOfRotation 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="CenterOfRotation" Width="150" TextAlignment="Center"/>

            <!-- CenterOfRotation(X, Y, Z) 데이터 바인딩 -->

            <Slider x:Name="CenterOfRotationX" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationX, ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="CenterOfRotationY" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationY, ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="CenterOfRotationZ" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationZ, ElementName=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- GlobalOffset 그룹-->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="GlobalOffset" Width="150" TextAlignment="Center"/>

            <!-- GlobalOffset(X, Y, Z) 데이터 바인딩 -->

            <Slider x:Name="GlobalOffsetX" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetX,
                           
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="GlobalOffsetY" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetY,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="GlobalOffsetZ" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetZ,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- LocalOffset 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="LocalOffset" Width="150" TextAlignment="Center"/>

            <!-- LocalOffset(X, Y, Z) 데이터 바인딩. -->

            <Slider x:Name="LocalOffsetX" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetX,
                            ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="LocalOffsetY" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetY,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="LocalOffsetZ" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetZ,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

    </StackPanel>

</UserControl> 





반응형
posted by Magic_kit
2009. 11. 27. 11:38 .Net Project/SilverLight 3.0
반응형
  Transform Group
- 각각 개별적으로 사용하여도 다양한 변환 효과를 표현
- 여러개의 Transform을 함께 적용하면 더욱 다양하고 멋진 효과를 표현 가능
- 객체에 다양한 Transform을 적용할 수 있도록 TransformGroup 클래스 제공 합니다


 
 Transform Group.Xaml

<UserControl x:Class="RiaTransform.FrmTransformGroup"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

   

    <Grid x:Name="LayoutRoot" Background="White">

        <TextBlock Text="SilverLight" FontSize="30">

            <TextBlock.RenderTransform>

                <TransformGroup>

                    <TranslateTransform X="10" Y="50"></TranslateTransform>

                    <ScaleTransform ScaleX="2" ScaleY="1.5"></ScaleTransform>

                    <SkewTransform AngleX="20" AngleY="15"></SkewTransform>

                    <RotateTransform Angle="-15"></RotateTransform>

                </TransformGroup>

            </TextBlock.RenderTransform>

        </TextBlock>

    </Grid>

</UserControl> 




반응형
posted by Magic_kit
2009. 11. 27. 11:36 .Net Project/SilverLight 3.0
반응형
  SkewTransform
- AngleX와 AngleY 프로퍼티에 설정한 값 만큼 객체를 기울입니다
- 기울린 객체는 항상 평행 사변형 유지
-  프로퍼티 설정하여 객체의 Transform 원점을 설정 가능

 
 SkewTransform.Xaml

<UserControl x:Class="RiaTransform.FrmSkeTransfrom"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

   

    <Grid x:Name="LayoutRoot" Background="White">

        <Rectangle Width="100" Height="100" Fill="Blue">

            <Rectangle.RenderTransform>

                <SkewTransform AngleX="1" AngleY="5" ></SkewTransform>

            </Rectangle.RenderTransform>           

        </Rectangle>

 

        <Rectangle Width="50" Height="50" Fill="Pink">

            <Rectangle.RenderTransform>

                <SkewTransform AngleX="10" AngleY="25"></SkewTransform>

            </Rectangle.RenderTransform>

        </Rectangle>

 

        <Rectangle Width="80" Height="80" Fill="Yellow">

            <Rectangle.RenderTransform>

                <SkewTransform AngleX="5" AngleY="55"></SkewTransform>

            </Rectangle.RenderTransform>

        </Rectangle>

    </Grid>

</UserControl> 




반응형
posted by Magic_kit
2009. 11. 27. 11:22 .Net Project/SilverLight 3.0
반응형
  ScaleTransform
 - ScaleX와 ScaleY 프로퍼티에 설정한 값만큼 객체의 스케일을 조정
 - 스케일 조정시 CenterX(기본값 0), CenterY(기본 값 0)
    프로퍼티를 설정하여 객체의 Transform 원점 설정 가능



  ScaleTransform

<UserControl x:Class="RiaTransform.FrmScaleTransfrom"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

   

    <Grid x:Name="LayoutRoot" Background="White">

        <Canvas Width="400" Height="400" Background="White">

            <Rectangle Width="100" Height="100" Fill="Green">

                <Rectangle.RenderTransform>

                    <ScaleTransform ScaleX="1.5" ScaleY="1.5"></ScaleTransform>

                </Rectangle.RenderTransform>              

            </Rectangle>

 

            <Rectangle Width="50" Height="50" Fill="Blue">

                <Rectangle.RenderTransform>

                    <ScaleTransform ScaleX="1.5" ScaleY="1.5"></ScaleTransform>

                </Rectangle.RenderTransform>

            </Rectangle>

 

 

        </Canvas>

    </Grid>

</UserControl> 




반응형
posted by Magic_kit