mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 23:43:39 +02:00
* 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
30 lines
1.4 KiB
Markdown
30 lines
1.4 KiB
Markdown
---
|
|
title: "How to: Animate a Rectangle"
|
|
ms.date: "03/30/2017"
|
|
dev_langs:
|
|
- "csharp"
|
|
- "vb"
|
|
helpviewer_keywords:
|
|
- "animation [WPF], rectangles"
|
|
- "rectangles [WPF], animating"
|
|
ms.assetid: 572ffb95-790d-4ace-adbf-b2ea8a90e75b
|
|
---
|
|
# How to: Animate a Rectangle
|
|
This example shows how to animate changes to the size and position of a rectangle.
|
|
|
|
## Example
|
|
The following example uses an instance of the <xref:System.Windows.Media.Animation.RectAnimation> class to animate the <xref:System.Windows.Media.RectangleGeometry.Rect%2A> property of a <xref:System.Windows.Media.RectangleGeometry>, which animates changes to the size and position of the rectangle.
|
|
|
|
[!code-csharp[BasicAnimations_snip#RectAnimationWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/BasicAnimations_snip/CSharp/RectAnimationExample.cs#rectanimationwholepage)]
|
|
[!code-vb[BasicAnimations_snip#RectAnimationWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BasicAnimations_snip/VisualBasic/RectAnimationExample.vb#rectanimationwholepage)]
|
|
|
|
## See also
|
|
|
|
- <xref:System.Windows.Media.Animation.RectAnimation>
|
|
- <xref:System.Windows.Media.RectangleGeometry.Rect%2A>
|
|
- <xref:System.Windows.Media.RectangleGeometry>
|
|
- [Animation Overview](animation-overview.md)
|
|
- [Graphics and Multimedia](index.md)
|
|
- [Graphics How-to Topics](graphics-how-to-topics.md)
|
|
- [Animation and Timing How-to Topics](animation-and-timing-how-to-topics.md)
|