Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-apply-a-drawing-to-a-3-d-model.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

1.7 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Apply a Drawing to a 3D Model 03/30/2017
drawings [WPF], applying to 3D models
3D models [WPF], applying drawings to
68357577-b7fc-446e-8be9-a8cc7df3a350

How to: Apply a Drawing to a 3D Model

This example shows how to use a xref:System.Windows.Media.DrawingBrush as the xref:System.Windows.Media.Media3D.Material applied to a 3D model.

The following code defines a xref:System.Windows.Media.DrawingGroup as the content of a xref:System.Windows.Media.DrawingBrush. The xref:System.Windows.Media.DrawingBrush is set as the xref:System.Windows.Media.Media3D.DiffuseMaterial.Brush%2A property of the xref:System.Windows.Media.Media3D.DiffuseMaterial applied to a 3D plane.

Note

It is often desirable to define complex objects and values like the drawing below as resources which can be reused and simplify your code. See XAML Resources for more information.

[!code-xaml3DGallery_snip#ApplyDrawingToMaterialInline1]

Example

The following code shows the entire sample.

[!code-xaml3DGallery_snip#ApplyDrawingToMaterialExampleWholePage]

See also