Public Shared Function Area(ByVal ptdWidth1 As PointD, ByVal ptdWidth2 As PointD, ByVal ptdHeight1 As PointD, ByVal ptdHeight2 As PointD) As Double Dim dblWidth As Double = ptdWidth2.X - ptdWidth1.X Dim dblHeight As Double = ptdHeight1.Y - ptdHeight2.Y Return (dblWidth * dblHeight) End Function
txtRectResult.Text = String.Format("{0:F}", Geometry.Rectangle.Area(ptdTopLeft.X, ptdTopLeft.Y, ptdBottomRight.X, ptdBottomRight.Y))