Introduction
i will explain Shows a classic B?zier curve in silverlight.
Description
Bézier curves connect two line segments using a complex mathematical formula that incorporates two control points that determine how the curve is shaped. Bézier curves are an ingredient in virtually every vector drawing application ever created because they’re remarkably flexible. Using nothing more than start point, end point, and two control points, you can create a surprisingly wide variety of smooth curves (including loops). Shows a classic Bézier curve. Two small circles indicate the control points, and a dashed line connects each control point to the end of the line it affects the most.
Example
CS
i will explain Shows a classic B?zier curve in silverlight.
Description
Bézier curves connect two line segments using a complex mathematical formula that incorporates two control points that determine how the curve is shaped. Bézier curves are an ingredient in virtually every vector drawing application ever created because they’re remarkably flexible. Using nothing more than start point, end point, and two control points, you can create a surprisingly wide variety of smooth curves (including loops). Shows a classic Bézier curve. Two small circles indicate the control points, and a dashed line connects each control point to the end of the line it affects the most.
Example
<UserControl x:Class="VC39.Page"
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>
<Path Stroke="Blue" StrokeThickness="5" Canvas.Top="20">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="10,10">
<BezierSegment Point1="130,30" Point2="40,140"
Point3="150,150"></BezierSegment>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path Stroke="Green" StrokeThickness="2" StrokeDashArray="5 2" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="10,10" EndPoint="130,30"></LineGeometry>
<LineGeometry StartPoint="40,140" EndPoint="150,150"></LineGeometry>
</GeometryGroup>
</Path.Data>
</Path>
<Path Fill="Red" Stroke="Red" StrokeThickness="8" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="130,30"></EllipseGeometry>
<EllipseGeometry Center="40,140"></EllipseGeometry>
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
</Grid>
</UserControl>
|
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 VC39
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
}
}
|
0 comments :
Post a Comment