PointF.Subtraction 运算符
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
按指定大小的负值平移 PointF。
重载
Subtraction(PointF, Size) | |
Subtraction(PointF, SizeF) |
Subtraction(PointF, Size)
- Source:
- PointF.cs
- Source:
- PointF.cs
- Source:
- PointF.cs
public:
static System::Drawing::PointF operator -(System::Drawing::PointF pt, System::Drawing::Size sz);
public static System.Drawing.PointF operator - (System.Drawing.PointF pt, System.Drawing.Size sz);
static member ( - ) : System.Drawing.PointF * System.Drawing.Size -> System.Drawing.PointF
Public Shared Operator - (pt As PointF, sz As Size) As PointF
参数
返回
平移后的 PointF。
适用于
Subtraction(PointF, SizeF)
- Source:
- PointF.cs
- Source:
- PointF.cs
- Source:
- PointF.cs
public:
static System::Drawing::PointF operator -(System::Drawing::PointF pt, System::Drawing::SizeF sz);
public static System.Drawing.PointF operator - (System.Drawing.PointF pt, System.Drawing.SizeF sz);
static member ( - ) : System.Drawing.PointF * System.Drawing.SizeF -> System.Drawing.PointF
Public Shared Operator - (pt As PointF, sz As SizeF) As PointF
参数
返回
平移后的 PointF。
示例
下面的代码示例演示如何使用 Subtraction 运算符。 若要运行此示例,请将以下代码粘贴到 Windows 窗体中。 处理窗体的 Paint 事件并调用 opSubtractionExample
,作为 e
PaintEventArgs传递。
private void OpSubtractionExample(PaintEventArgs e)
{
PointF point1 = new PointF(120.5F, 120F);
SizeF size1 = new SizeF(20.5F, 20.5F);
PointF point2 = point1 - size1;
e.Graphics.DrawLine(Pens.Blue, point1, point2);
}
Private Sub OpSubtractionExample(ByVal e As PaintEventArgs)
Dim point1 As New PointF(120.5F, 120F)
Dim size1 As New SizeF(120.5F, 30.5F)
Dim point2 As PointF = point1 - size1
e.Graphics.DrawLine(Pens.Blue, point1, point2)
End Sub
注解
运算符Subtraction从 的 x 坐标中Height减Width去指定大小的 ,PointF从 的 y 坐标减去 PointF。
此运算符的等效方法是 PointF.Subtract(PointF, SizeF)