'.NET프로그래밍'에 해당되는 글 690건

  1. 2009.11.26 <BezierSegment>
  2. 2009.11.26 <ArcSegment> - 아치호 모양
  3. 2009.11.26 <PathGeometry>
  4. 2009.11.26 <RectangleGeometry>
  5. 2009.11.26 <EllipseGeometry>
  6. 2009.11.26 <LineGeometry>
  7. 2009.11.26 <MediaElement>
  8. 2009.11.26 <Image /> 컨트롤
  9. 2009.11.25 도형(Shape) - <Path> : 모든 모양
  10. 2009.11.25 도형(Shape) - <Polygon> : 다각형(닫혀있는 모양)

 
[FrmBezierSegment.xaml]



<UserControl x:Class="RiaGeometry.FrmBezierSegment"

    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">

        <Path Stroke="Black" StrokeThickness="10">

            <Path.Data>

                <PathGeometry>

                    <PathFigure StartPoint="0, 0">

                        <BezierSegment

                            Point1="150, 0"

                            Point2="50, 150"

                            Point3="200, 200">

                        </BezierSegment>

                    </PathFigure>

                </PathGeometry>

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 

 















'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

Geometry의 줄임 표현 (경로 태그 구문/경로 미니 언어)  (0) 2009.11.26
<GeometryGroup>  (0) 2009.11.26
<ArcSegment> - 아치호 모양  (0) 2009.11.26
<PathGeometry>  (0) 2009.11.26
<RectangleGeometry>  (0) 2009.11.26
Posted by holland14
:

 

[FrmArcSegment.xaml]




<UserControl x:Class="RiaGeometry.FrmArcSegment"

    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">

        <Path Stroke="Black" StrokeThickness="10">

            <Path.Data>

                <PathGeometry>

                    <PathFigure StartPoint="20, 20">

                        <ArcSegment Size="15, 30" Point="100, 100">

                        </ArcSegment>

                    </PathFigure>

                </PathGeometry>

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 

 










'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<GeometryGroup>  (0) 2009.11.26
<BezierSegment>  (0) 2009.11.26
<PathGeometry>  (0) 2009.11.26
<RectangleGeometry>  (0) 2009.11.26
<EllipseGeometry>  (0) 2009.11.26
Posted by holland14
:



[FrmPathGeometry.xaml]



<UserControl x:Class="RiaGeometry.FrmPathGeometry"

    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">

        <Path Fill="Red" Stroke="Black" StrokeThickness="5">

            <Path.Data>

                <PathGeometry>

                    <!-- 첫번째 -->

                    <PathFigure StartPoint="20, 20" IsClosed="True">

                        <LineSegment Point="20, 100"></LineSegment>

                        <LineSegment Point="100, 100"></LineSegment>

                    </PathFigure>

 

                    <!-- 두번째 -->

                    <PathFigure StartPoint="90, 20" IsClosed="True">

                        <LineSegment Point="20, 100"></LineSegment>

                        <LineSegment Point="100, 100"></LineSegment>

                    </PathFigure>

                </PathGeometry>

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 

 


















'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<BezierSegment>  (0) 2009.11.26
<ArcSegment> - 아치호 모양  (0) 2009.11.26
<RectangleGeometry>  (0) 2009.11.26
<EllipseGeometry>  (0) 2009.11.26
<LineGeometry>  (0) 2009.11.26
Posted by holland14
:


[FrmRectangleGeometry.xaml]



<UserControl x:Class="RiaGeometry.FrmRectangleGeometry"

    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">

        <Ellipse Width="300" Height="100" Fill="Yellow" Stroke="Red">

            <Ellipse.Clip>

                <RectangleGeometry Rect="40,0 250,100">

                </RectangleGeometry>

            </Ellipse.Clip>       

        </Ellipse>

    </Grid>

</UserControl>


 













'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<ArcSegment> - 아치호 모양  (0) 2009.11.26
<PathGeometry>  (0) 2009.11.26
<EllipseGeometry>  (0) 2009.11.26
<LineGeometry>  (0) 2009.11.26
<MediaElement>  (0) 2009.11.26
Posted by holland14
:



[FrmEllipseGeometry.xaml]




<UserControl x:Class="RiaGeometry.FrmEllipseGeometry"

    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="300" Height="300" Fill="Yellow"

            Stroke="Blue" StrokeThickness="3">

            <Rectangle.Clip>

                <EllipseGeometry Center="80, 80" RadiusX="100" RadiusY="100">

                </EllipseGeometry>

            </Rectangle.Clip>

        </Rectangle>

 

    </Grid>

</UserControl>

 

 











'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<PathGeometry>  (0) 2009.11.26
<RectangleGeometry>  (0) 2009.11.26
<LineGeometry>  (0) 2009.11.26
<MediaElement>  (0) 2009.11.26
<Image /> 컨트롤  (0) 2009.11.26
Posted by holland14
:



[FrmLineGeometry.xaml]



<UserControl x:Class="RiaGeometry.FrmLineGeometry"

    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">

        <Path Fill="Red" Stroke="Blue">

            <Path.Data>

                <LineGeometry StartPoint="30, 30" EndPoint="100, 100"></LineGeometry>

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 














 

'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<RectangleGeometry>  (0) 2009.11.26
<EllipseGeometry>  (0) 2009.11.26
<MediaElement>  (0) 2009.11.26
<Image /> 컨트롤  (0) 2009.11.26
도형(Shape) - <Path> : 모든 모양  (0) 2009.11.25
Posted by holland14
:


--> 아래 그림과 같이 '솔루션 탐색기'에서 "Video"폴더를 새로만들고, Video폴더 안에 "동영상파일"인 'Silverlight.wmv'을 추가한 후 "Video"폴더를 잘라내서, "ClientBin"폴더에 붙여넣기 한다. 







-------------------------------------------------------------------------------------




[MainPage.xaml]


<UserControl x:Class="RiaMediaElement.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:DesignHeight="300" d:DesignWidth="400">

 

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

        <StackPanel>

            <MediaElement

                x:Name="myVideo"

                Source="Video/Silverlight.wmv"

                AutoPlay="False"

                IsMuted="False">

            </MediaElement>

            <StackPanel Orientation="Horizontal">

                <Button x:Name="btnStart" Content="재생"></Button>

                <Button x:Name="btnStop" Content="중지"></Button>

            </StackPanel>

        </StackPanel>

    </Grid>

</UserControl>

 

 


-------------------------------------------------------------------------------------




[MainPage.xaml.cs]

using System;

using System.Collections.Generic;

using System.Linq;

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Animation;

using System.Windows.Shapes;

 

namespace RiaMediaElement

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

 

            btnStart.Click += new RoutedEventHandler(btnStart_Click);

            btnStop.Click += new RoutedEventHandler(btnStop_Click);

        }

 

        void btnStop_Click(object sender, RoutedEventArgs e)

        {

            myVideo.Stop(); // 중지

        }

 

        void btnStart_Click(object sender, RoutedEventArgs e)

        {

            //myVideo.AutoPlay = true;

            myVideo.Play(); // 재생

        }

    }

}

 

 


-------------------------------------------------------------------------------------

 


[실행결과]











'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

<EllipseGeometry>  (0) 2009.11.26
<LineGeometry>  (0) 2009.11.26
<Image /> 컨트롤  (0) 2009.11.26
도형(Shape) - <Path> : 모든 모양  (0) 2009.11.25
도형(Shape) - <Polygon> : 다각형(닫혀있는 모양)  (0) 2009.11.25
Posted by holland14
:




--> 아래그림과 같이 '솔루션 탐색기'에서 "images"폴더를 만들고, "images"폴더안에 이미지파일인 "img.jpg"를 추가한다.









-------------------------------------------------------------------------------------




[MainPage.xaml]




<UserControl x:Class="RiaImage.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:DesignHeight="300" d:DesignWidth="400">

 

    <Grid x:Name="LayoutRoot" Background="Silver" Height="300" Width="400">

        <Image Source="./images/img.jpg" Margin="30"

            Stretch="UniformToFill"></Image>

    </Grid>

</UserControl>

 

 

 


-------------------------------------------------------------------------------------

 


[실행결과]








-------------------------------------------------------------------------------------




** 참고 **

* DLL 파일에 이미지 포함시키는 방법

- 빌드시 이미지 속성에서 "리소스"로 설정
- <Images Source="/DLL명;component/이미지경로" />

샘플예제
<Image Source="/RiaImage;component/images/img.jpg"




[MainPage.xaml]


<UserControl x:Class="RiaImage.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:DesignHeight="300" d:DesignWidth="400">

 

    <Grid x:Name="LayoutRoot" Background="Silver" Height="300" Width="400">

        <Image Source="/RiaImage;component/images/img.jpg" Margin="30"

            Stretch="UniformToFill"></Image>

    </Grid>

</UserControl>

 

 

 

 


-------------------------------------------------------------------------------------

 


[실행결과]








Posted by holland14
:

 

[FrmPath.xaml]



<UserControl x:Class="RiaShape.FrmPath"

    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">

        <!-- 모든 모양 -->

        <Path Fill="Yellow">

            <Path.Data>

                <RectangleGeometry Rect="10,10,100,100"></RectangleGeometry>

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 

 


-------------------------------------------------------------------------------------

 


[실행결과]









 

 

Posted by holland14
:

 

[FrmPolygon.xaml]



<UserControl x:Class="RiaShape.FrmPolygon"

    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">

   

    <Canvas>

        <Polygon Canvas.Left="50" Canvas.Top="50" Points="0,0 50,0 50,50" Stroke="Blue" StrokeThickness="5" />

        <Polygon Canvas.Left="120" Canvas.Top="50" Points="0,0 50,0 50,50" Fill="Orange" Stroke="Blue" StrokeThickness="10" />      

       

        <!-- 별그리기 도전해보기 -->

       

    </Canvas>  

</UserControl>

 

 


-------------------------------------------------------------------------------------

 


[실행결과]







Posted by holland14
: