Introduction
i will explain Creates the gentle arc in Silverlight
Description
Arcs are a little more interesting than straight lines. You identify the end point of the line using the ArcSegment.Point property, just as you would with a LineSegment. However, the PathFigure draws a curved line from the starting point (or the end point of the previous segment) to the end point of your arc. This curved connecting line is actually a portion of the edge of an ellipse.
Obviously, the end point isn’t enough information to draw the arc because there are many curves (some gentle, some more extreme) that could connect two points. You also need to indicate the size of the imaginary ellipse that’s being used to draw the arc. You do this using the ArcSegment.Size property, which supplies the x radius and the y radius of the ellipse. The larger the ellipse size of the imaginary ellipse, the more gradually its edge curves.
Example
CS
i will explain Creates the gentle arc in Silverlight
Description
Arcs are a little more interesting than straight lines. You identify the end point of the line using the ArcSegment.Point property, just as you would with a LineSegment. However, the PathFigure draws a curved line from the starting point (or the end point of the previous segment) to the end point of your arc. This curved connecting line is actually a portion of the edge of an ellipse.
Obviously, the end point isn’t enough information to draw the arc because there are many curves (some gentle, some more extreme) that could connect two points. You also need to indicate the size of the imaginary ellipse that’s being used to draw the arc. You do this using the ArcSegment.Size property, which supplies the x radius and the y radius of the ellipse. The larger the ellipse size of the imaginary ellipse, the more gradually its edge curves.
Example
<UserControl x:Class="VC38.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">
<Path Stroke="Blue" StrokeThickness="3">
<Path.Data>
<PathGeometry>
<PathFigure IsClosed="False" StartPoint="10,100" >
<ArcSegment Point="250,150" Size="200,300" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</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 VC38
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
}
}
|
0 comments :
Post a Comment