Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-create-a-quadratic-bezier-curve.md
T
ChristyandAndy De George 911443635a Update how-to-create-a-quadratic-bezier-curve.md (#223)
* Update how-to-create-a-quadratic-bezier-curve.md

Removed unnecessary [xaml] tags

* Update how-to-create-a-quadratic-bezier-curve.md

* Update how-to-create-a-quadratic-bezier-curve.md

Co-authored-by: Andy De George <[email protected]>
2021-03-08 17:19:04 -08:00

1.9 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Create a Quadratic Bezier Curve 03/30/2017
Bezier curves [WPF], creating
quadratic Bezier curves [WPF], creating
graphics [WPF], quadratic Bezier curves
cd8fca4a-504e-4fd8-92ea-2969065a6e02

How to: Create a Quadratic Bezier Curve

This example shows how to create a quadratic Bezier curve. To create a quadratic Bezier curve, use the xref:System.Windows.Media.PathGeometry, xref:System.Windows.Media.PathFigure, and xref:System.Windows.Media.QuadraticBezierSegment classes.

Example

In the following examples, a quadratic Bezier curve is drawn from (10,100) to (300,100). The curve has a control point of (200,200).

In [!INCLUDETLA#tla_xaml], you can use attribute syntax to describe a path.

[!code-xamlGeometrySample#54]

(Note that this attribute syntax actually creates a xref:System.Windows.Media.StreamGeometry, a lighter-weight version of a xref:System.Windows.Media.PathGeometry. For more information, see the Path Markup Syntax page.)

In [!INCLUDETLA2#tla_xaml], you may also draw a quadratic Bezier curve using object element syntax. The following is equivalent to the previous [!INCLUDETLA2#tla_xaml] example.

[!code-xamlGeometrySample#34]

This example is part of larger sample; for the complete sample, see the Geometries Sample.

See also