mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 16:06:07 +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
29 lines
2.1 KiB
Markdown
29 lines
2.1 KiB
Markdown
---
|
|
title: "How to: Apply a GuidelineSet to a Drawing"
|
|
ms.date: "03/30/2017"
|
|
helpviewer_keywords:
|
|
- "GuidelineSet property [WPF], applying to drawings"
|
|
- "graphics [WPF], GuidelineSet property"
|
|
ms.assetid: 45f3e0b4-8820-45a7-b865-b8ea5b17b0c8
|
|
---
|
|
# How to: Apply a GuidelineSet to a Drawing
|
|
This example shows how to apply a <xref:System.Windows.Media.GuidelineSet> to a <xref:System.Windows.Media.DrawingGroup>.
|
|
|
|
The <xref:System.Windows.Media.DrawingGroup> class is the only type of <xref:System.Windows.Media.Drawing> that has a <xref:System.Windows.Media.DrawingGroup.GuidelineSet%2A> property. To apply a <xref:System.Windows.Media.GuidelineSet> to another type of <xref:System.Windows.Media.Drawing>, add it to a <xref:System.Windows.Media.DrawingGroup> and then apply the <xref:System.Windows.Media.GuidelineSet> to your <xref:System.Windows.Media.DrawingGroup>.
|
|
|
|
## Example
|
|
The following example creates two <xref:System.Windows.Media.DrawingGroup> objects that are almost identical; the only difference is: the second <xref:System.Windows.Media.DrawingGroup> has a <xref:System.Windows.Media.GuidelineSet> and the first does not.
|
|
|
|
The following illustration shows the output from the example. Because the rendering difference between the two <xref:System.Windows.Media.DrawingGroup> objects is so subtle, portions of the drawings are enlarged.
|
|
|
|

|
|
|
|
[!code-csharp[DrawingMiscSnippets_snip#GraphicsMMDrawingGroupGuidelineSetExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/DrawingMiscSnippets_snip/CSharp/DrawingGroupGuidelineSetExample.cs#graphicsmmdrawinggroupguidelinesetexamplewholepage)]
|
|
[!code-xaml[DrawingMiscSnippets_snip#GraphicsMMDrawingGroupGuidelineSetExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/DrawingMiscSnippets_snip/XAML/DrawingGroupGuidelineSetExample.xaml#graphicsmmdrawinggroupguidelinesetexamplewholepage)]
|
|
|
|
## See also
|
|
|
|
- <xref:System.Windows.Media.DrawingGroup>
|
|
- <xref:System.Windows.Media.GuidelineSet>
|
|
- [Drawing Objects Overview](drawing-objects-overview.md)
|