vb System.Drawing.Size.Round类(方法)实例源码

下面列出了vb System.Drawing.Size.Round 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Drawin   
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

作者:VB程序    项目:System.Drawin   
' 导入命名空间
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.Round(sz1)

        Console.WriteLine(sz4.ToString())
   End Sub
End class


问题


面经


文章

微信
公众号

扫码关注公众号