Files
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

1.9 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Paint an Area with a Visual 03/30/2017
csharp
vb
painting [WPF]
visuals [WPF], painting with
brushes [WPF], painting with visuals
35f92996-1d03-4542-acc4-3469dcf09492

How to: Paint an Area with a Visual

This example shows how to use the xref:System.Windows.Media.VisualBrush class to paint an area with a xref:System.Windows.Media.Visual.

In the following example, several controls and a panel are used as the background of a rectangle.

Example

[!code-xamlBrushOverviewExamples_snip#GraphicsMMVisualBrushAsRectangleBackgroundExample]

[!code-csharpBrushOverviewExamples_procedural_snip#GraphicsMMVisualBrushAsRectangleBackgroundExample1] [!code-vbBrushOverviewExamples_procedural_snip#GraphicsMMVisualBrushAsRectangleBackgroundExample1]

For more information about xref:System.Windows.Media.VisualBrush and additional examples, see the Painting with Images, Drawings, and Visuals overview.

This code example is part of a larger example provided for the xref:System.Windows.Media.VisualBrush class. For the complete sample, see the VisualBrush Sample.

See also