DrawingContext.PushGuidelineSet Method
Pushes the specified GuidelineSet onto the drawing context.
Assembly: PresentationCore (in PresentationCore.dll)
The guideline set applies to all subsequent drawing commands until it is removed by the Pop operation.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Ordering Problem with PushTransform
I have found that PushGuidelineSet will sometimes not work if you follow it with PushTransform (with a TranslateTransform). It doesn't always happen- I've only seen it drawing glyph-runs.
I guess there must be some sort of floating-point math shenanigans going on, so the guideline no longer lines up with the geometry.
Anyway, the workaround is dead simple: first push your transform, then push your guideline set, then draw stuff.
I guess there must be some sort of floating-point math shenanigans going on, so the guideline no longer lines up with the geometry.
Anyway, the workaround is dead simple: first push your transform, then push your guideline set, then draw stuff.
- 10/20/2011
- Daniel Normal Johnson
- 10/20/2011
- Daniel Normal Johnson