Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-create-a-cubic-bezier-curve.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.0 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Create a Cubic Bezier Curve 03/30/2017
curves [WPF], cubic Bezier
Bezier curves [WPF], cubic
graphics [WPF], cubic Bezier curves
cubic Bezier curves [WPF]
450a3a77-7c57-48b0-a008-0f6051add980

How to: Create a Cubic Bezier Curve

This example shows how to create a cubic Bezier curve. To create a cubic Bezier curve, use the xref:System.Windows.Media.PathGeometry, xref:System.Windows.Media.PathFigure, and xref:System.Windows.Media.BezierSegment classes. To display the resulting geometry, use a xref:System.Windows.Shapes.Path element, or use it with a xref:System.Windows.Media.GeometryDrawing or a xref:System.Windows.Media.DrawingContext. In the following examples, a cubic Bezier curve is drawn from (10, 100) to (300, 100). The curve has control points of (100, 0) and (200, 200).

Example

[xaml]

In [!INCLUDETLA#tla_xaml], you may use abbreviated markup syntax to describe a path.

[!code-xamlGeometrySample#53]

[xaml]

In [!INCLUDETLA2#tla_xaml], you can also draw a cubic Bezier curve using object tags. The following is equivalent to the previous [!INCLUDETLA2#tla_xaml] example.

[!code-xamlGeometrySample#33]

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

See also