本文整理汇总了C#中MS.Internal.PtsHost.UnsafeNativeMethods.PTS.FromTextDpi方法的典型用法代码示例。如果您正苦于以下问题:C# PTS.FromTextDpi方法的具体用法?C# PTS.FromTextDpi怎么用?C# PTS.FromTextDpi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MS.Internal.PtsHost.UnsafeNativeMethods.PTS
的用法示例。
在下文中一共展示了PTS.FromTextDpi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateViewport
//-------------------------------------------------------------------
// Update the viewport
//-------------------------------------------------------------------
internal void UpdateViewport(ref PTS.FSRECT viewport, bool drawBackground)
{
Rect contentViewport;
// Transform point to PtsPage coordinate system.
// NOTE: TransformToAncestor is safe (will never throw an exception).
GeneralTransform transform = this.PageVisual.Child.TransformToAncestor(this.PageVisual);
transform = transform.Inverse;
contentViewport = viewport.FromTextDpi();
if (transform != null)
{
contentViewport = transform.TransformBounds(contentViewport);
}
if(!IsDisposed)
{
// Draw background
if (drawBackground)
{
this.PageVisual.DrawBackground((Brush)_structuralCache.PropertyOwner.GetValue(FlowDocument.BackgroundProperty), contentViewport);
}
using (_structuralCache.SetDocumentVisualValidationContext(this))
{
PTS.FSRECT contentViewportTextDpi = new PTS.FSRECT(contentViewport);
_ptsPage.UpdateViewport(ref contentViewportTextDpi);
_structuralCache.DetectInvalidOperation();
}
ValidateTextView();
}
}