Point.Subtraction Operatör
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Subtraction(Point, Point) |
Belirtilen Point başka bir belirtilenden Point çıkarır ve farkı olarak Vectordöndürür. |
Subtraction(Point, Vector) |
Belirtilen öğesini belirtilenden Vector Point çıkarır ve sonuçta Pointelde edilen değerini döndürür. |
Subtraction(Point, Point)
public:
static System::Windows::Vector operator -(System::Windows::Point point1, System::Windows::Point point2);
public static System.Windows.Vector operator - (System.Windows.Point point1, System.Windows.Point point2);
static member ( - ) : System.Windows.Point * System.Windows.Point -> System.Windows.Vector
Public Shared Operator - (point1 As Point, point2 As Point) As Vector
Parametreler
- point1
- Point
Çıkarıldığı point2
nokta.
- point2
- Point
'den point1
çıkarıla noktası.
Döndürülenler
ile point2
arasındaki point1
fark.
Örnekler
Aşağıdaki örnekte, aşırı yüklenmiş (-) işlecini kullanarak bir Point öğesinin başka Point birinden Vector nasıl çıkarılıp döndürüleceği gösterilmektedir.
private Vector overloadedSubtractionOperatorExample2()
{
Point point1 = new Point(10, 5);
Point point2 = new Point(15, 40);
// Subtracts a Point from another Point using the overloaded subtraction (-)
// operator and returns the difference as a Vector.
// vectorResult is equal to (-5, -35).
Vector vectorResult = point1 - point2;
return vectorResult;
}
Private Function overloadedSubtractionOperatorExample2() As Vector
Dim point1 As New Point(10, 5)
Dim point2 As New Point(15, 40)
' Subtracts a Point from another Point using the overloaded subtraction (-)
' operator and returns the difference as a Vector.
' vectorResult is equal to (-5, -35).
Dim vectorResult As Vector = point1 - point2
Return vectorResult
End Function
Ayrıca bkz.
Şunlara uygulanır
.NET Framework 4.8 ve diğer sürümler
Ürün | Sürümler |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |
Subtraction(Point, Vector)
public:
static System::Windows::Point operator -(System::Windows::Point point, System::Windows::Vector vector);
public static System.Windows.Point operator - (System.Windows.Point point, System.Windows.Vector vector);
static member ( - ) : System.Windows.Point * System.Windows.Vector -> System.Windows.Point
Public Shared Operator - (point As Point, vector As Vector) As Point
Parametreler
- point
- Point
Çıkarıldığı vector
nokta.
- vector
- Vector
'den point1
çıkarıla vektörü.
Döndürülenler
ile vector
arasındaki point
fark.
Örnekler
Aşağıdaki örnek, aşırı yüklenmiş (-) işlecini kullanarak bir Vector Point öğesinin nasıl çıkarılmış olduğunu gösterir.
private Point overloadedSubtractionOperatorExample1()
{
Point point1 = new Point(10, 5);
Vector vector1 = new Vector(20, 30);
// Subtracts a Vector from a Point using the overloaded subtraction (-) operator.
// pointResult is equal to (-10, -25)
Point pointResult = point1 - vector1;
return pointResult;
}
Private Function overloadedSubtractionOperatorExample1() As Point
Dim point1 As New Point(10, 5)
Dim vector1 As New Vector(20, 30)
' Subtracts a Vector from a Point using the overloaded subtraction (-) operator.
' pointResult is equal to (-10, -25)
Dim pointResult As Point = point1 - vector1
Return pointResult
End Function
Ayrıca bkz.
Şunlara uygulanır
.NET Framework 4.8 ve diğer sürümler
Ürün | Sürümler |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |