* 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
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 |
|
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]