Offset Method
Collapse the table of content
Expand the table of content

Point4D.Offset Method (Double, Double, Double, Double)

 

Translates the Point4D structure by the specified amounts.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public void Offset(
	double deltaX,
	double deltaY,
	double deltaZ,
	double deltaW
)

Parameters

deltaX
Type: System.Double

The amount to offset the X coordinate of this Point4D structure.

deltaY
Type: System.Double

The amount to offset the Y coordinate of this Point4D structure.

deltaZ
Type: System.Double

The amount to offset the Z coordinate of this Point4D structure.

deltaW
Type: System.Double

The amount to offset the W coordinate of this Point4D structure.

Note that calling the Offset method will only have an effect if you can change the W, X, Y, and Z properties directly. Because Point4D is a value type, if you reference a Point4D object by using a property or indexer, you get a copy of the object, not a reference to the object. If you attempt to change W, X, Y, or Z on a property or indexer reference, a compiler error occurs. Similarly, calling Offset on the property or indexer will not change the underlying object. If you want to change the value of a Point4D that is referenced as a property or indexer, create a new Point4D, modify its fields, and then assign the Point4D back to the property or indexer. 

The following example shows how to offset a Point4D structure.

                  // Offsets the X, Y, Z, and W values of a Point4D.

                  Point4D point1 = new Point4D(10, 5, 1, 4);

                  point1.Offset(20, 30, 40, 50);
                  // point1 is equal to (30, 35, 41, 54)

                  // Displaying Results
                  syntaxString = "point1.Offset(20, 30, 41, 54);";
                  resultType = "Point4D";
operationString = "Offsetting a Point4D";
ShowResults(point1.ToString(), syntaxString, resultType, operationString);

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft