本文整理匯總了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