Point.Explicit 연산자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| Name | Description |
|---|---|
| Explicit(Point to Vector) | |
| Explicit(Point to Size) |
Explicit(Point to Vector)
public:
static explicit operator System::Windows::Vector(System::Windows::Point point);
public static explicit operator System.Windows.Vector(System.Windows.Point point);
static member op_Explicit : System.Windows.Point -> System.Windows.Vector
Public Shared Narrowing Operator CType (point As Point) As Vector
매개 변수
- point
- Point
변환할 점입니다.
반품
값이 X 점 값과 같고 점 X 값과 Y 같은 값이 있는 벡터입니다 Y .
예제
다음 예제에서는 명시적으로 변환 Point 하는 방법을 보여 있습니다 Vector.
private Vector overloadedExplicitOperatorVectorExample()
{
Point point1 = new Point(10, 5);
// Explicitly converts a Point structure into a Vector structure.
// returnVector is equal to (10,5).
Vector returnVector = (Vector)point1;
return returnVector;
}
Private Function overloadedExplicitOperatorVectorExample() As Vector
Dim point1 As New Point(10, 5)
' Explicitly converts a Point structure into a Vector structure.
' returnVector is equal to (10,5).
Dim returnVector As Vector = CType(point1, Vector)
Return returnVector
End Function
적용 대상
Explicit(Point to Size)
public:
static explicit operator System::Windows::Size(System::Windows::Point point);
public static explicit operator System.Windows.Size(System.Windows.Point point);
static member op_Explicit : System.Windows.Point -> System.Windows.Size
Public Shared Narrowing Operator CType (point As Point) As Size
매개 변수
- point
- Point
변환할 점입니다.
반품
Size 이 점의 값과 Width 같고 이 점의 X 값과 Height 같은 구조체입니다Y.
예제
다음 예제에서는 명시적으로 변환 Point 하는 방법을 보여 있습니다 Size.
private Size overloadedExplicitOperatorSizeExample()
{
Point point1 = new Point(10, 5);
// Explicitly converts a Point structure into a Size structure.
// returnSize has a width of 10 and a height of 5
Size returnSize = (Size)point1;
return returnSize;
}
Private Function overloadedExplicitOperatorSizeExample() As Size
Dim point1 As New Point(10, 5)
' Explicitly converts a Point structure into a Size structure.
' returnSize has a width of 10 and a height of 5
Dim returnSize As Size = CType(point1, Size)
Return returnSize
End Function
설명
구조체는 Size 음수일 수 없으므로 점과 X 속성의 Y 절대값이 사용됩니다.