当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET Point.Addition操作符代码示例

本文整理汇总了VB.NET中System.Drawing.Point.Addition操作符的典型用法代码示例。如果您正苦于以下问题:VB.NET Point.Addition操作符的具体用法?VB.NET Point.Addition怎么用?VB.NET Point.Addition使用的例子?那么恭喜您, 这里精选的操作符代码示例或许可以为您提供帮助。您也可以进一步了解该操作符所在System.Drawing.Point的用法示例。


在下文中一共展示了Point.Addition操作符的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: CreatePointsAndSizes

Private Sub CreatePointsAndSizes(ByVal e As PaintEventArgs)

    ' Create the starting point.
    Dim startPoint As New Point(subtractButton.Size)

    ' Use the addition operator to get the end point.
    Dim endPoint As Point = Point.op_Addition(startPoint, _
        New Size(140, 150))

    ' Draw a line between the points.
    e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)

    ' Convert the starting point to a size and compare it to the
    ' subtractButton size.  
    Dim buttonSize As Size = Point.op_Explicit(startPoint)
    If (Size.op_Equality(buttonSize, subtractButton.Size)) Then

        ' If the sizes are equal, tell the user.
        e.Graphics.DrawString("The sizes are equal.", _
            New Font(Me.Font, FontStyle.Italic), _
            Brushes.Indigo, 10.0F, 65.0F)
    End If

End Sub
开发者ID:VB.NET开发者,项目名称:System.Drawing,代码行数:24,代码来源:Point.Addition


注:本文中的System.Drawing.Point.Addition操作符示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。