本文整理汇总了VB.NET中System.Drawing.Size.Truncate方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Size.Truncate方法的具体用法?VB.NET Size.Truncate怎么用?VB.NET Size.Truncate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了Size.Truncate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: TruncateAndRoundSizes
Private Sub TruncateAndRoundSizes()
' Create a SizeF.
Dim theSize As New SizeF(75.9, 75.9)
' Round the Size.
Dim roundedSize As Size = Size.Round(theSize)
' Truncate the Size.
Dim truncatedSize As Size = Size.Truncate(theSize)
'Print out the values on two labels.
Label1.Text = "Rounded size = " & roundedSize.ToString()
Label2.Text = "Truncated size = " & truncatedSize.ToString
End Sub
示例2: Test
' 导入命名空间
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
public class Test
public Shared Sub Main
Dim pt1 As New PointF(30.6F, 30.8F)
Dim pt2 As New PointF(50.3F, 60.7F)
Dim pt3 As New PointF(110.3F, 80.5F)
Dim sz1 As New SizeF(pt1)
Dim sz2 As New SizeF(pt2)
Dim sz3 As New SizeF(pt3)
Dim sz4 As Size = Size.Truncate(sz1)
Console.WriteLine(sz4.ToString())
End Sub
End class