PointF.Subtraction Operator
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Translates a PointF by the negative of a specified size.
Overloads
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
Parameters
Returns
The translated PointF.
Applies to
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
Parameters
Returns
The translated PointF.
Examples
The following code example demonstrates how to use the Subtraction operator. To run this example, paste the following code into a Windows Form. Handle the form's Paint event and call opSubtractionExample
, passing e
as 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
Remarks
The Subtraction operator subtracts the Width of the specified size from the x-coordinate of the PointF and the Height from the y-coordinate of the PointF.
The equivalent method for this operator is PointF.Subtract(PointF, SizeF)