VB.Net Tutorial/2D Graphics/Size — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 12:54, 26 мая 2010

Size.Ceiling

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.Ceiling(sz1)
        Console.WriteLine(sz4.ToString())
   End Sub
End class
{Width=31, Height=31}

Size.Round

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
{Width=31, Height=31}

Size.Truncate

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
{Width=30, Height=30}