PointF.Equality(PointF, PointF) 연산자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
public:
static bool operator ==(System::Drawing::PointF left, System::Drawing::PointF right);
public static bool operator ==(System.Drawing.PointF left, System.Drawing.PointF right);
static member ( = ) : System.Drawing.PointF * System.Drawing.PointF -> bool
Public Shared Operator == (left As PointF, right As PointF) As Boolean
매개 변수
반품
true
X 왼쪽 및 오른쪽 Y 구조체의 값과 PointF 값이 같으면 이고, false그렇지 않으면 .
예제
다음 코드 예제에서는 연산자를 사용하는 방법을 보여 줍니다 Equality . 이 예제를 실행하려면 다음 코드를 Windows Form에 붙여넣습니다. 양식의 Paint 이벤트를 처리하고 호출opAdditionExample하여 다음으로 e전달 PaintEventArgs 합니다.
private void OpAdditionExample(PaintEventArgs e)
{
PointF point1 = new PointF(120.5F, 120F);
SizeF size1 = new SizeF(120.5F, 30.5F);
RectangleF rect1 = new RectangleF(point1, size1);
if (new PointF(rect1.Right, rect1.Bottom) == point1 + size1)
e.Graphics.DrawString("They are equal", this.Font, Brushes.Black, rect1);
else
e.Graphics.DrawString("They are not equal", this.Font, Brushes.Red, rect1);
}
Private Sub OpAdditionExample(ByVal e As PaintEventArgs)
Dim size1 As New SizeF(120.5F, 30.5F)
Dim point1 As New PointF(20.5F, 20F)
Dim rect1 As New RectangleF(point1, size1)
If New PointF(rect1.Right, rect1.Bottom) = point1 + size1 Then
e.Graphics.DrawString("They are equal", Me.Font, Brushes.Black, rect1)
Else
e.Graphics.DrawString("They are not equal", Me.Font, Brushes.Red, rect1)
End If
End Sub