本文整理汇总了VB.NET中System.Printing.PageMediaSize类的典型用法代码示例。如果您正苦于以下问题:VB.NET PageMediaSize类的具体用法?VB.NET PageMediaSize怎么用?VB.NET PageMediaSize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageMediaSize类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: PerformTransform
''' <summary>
''' Returns a scaled copy of a given visual transformed to
''' fit for printing to a specified print queue.</summary>
''' <param name="v">
''' The visual to be printed.</param>
''' <param name="pq">
''' The print queue to be output to.</param>
''' <returns>
''' The root element of the transformed visual.</returns>
Private Function PerformTransform(ByVal v As Visual, ByVal pq As PrintQueue) As Visual
Dim root As New ContainerVisual()
Const inch As Double = 96
' Set the margins.
Dim xMargin As Double = 1.25 * inch
Dim yMargin As Double = 1 * inch
Dim pt As PrintTicket = pq.UserPrintTicket
Dim printableWidth As Double = pt.PageMediaSize.Width.Value
Dim printableHeight As Double = pt.PageMediaSize.Height.Value
Dim xScale As Double = (printableWidth - xMargin * 2) / printableWidth
Dim yScale As Double = (printableHeight - yMargin * 2) / printableHeight
root.Children.Add(v)
root.Transform = New MatrixTransform(xScale, 0, 0, yScale, xMargin, yMargin)
Return root
End Function ' end:PerformTransform()
开发者ID:VB.NET开发者,项目名称:System.Printing,代码行数:29,代码来源:PageMediaSize
注:本文中的System.Printing.PageMediaSize类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论