本文整理汇总了C#中System.Windows.Point结构体的典型用法代码示例。如果您正苦于以下问题:C# Point结构体的具体用法?C# Point怎么用?C# Point使用的例子?那么, 这里精选的结构体代码示例或许可以为您提供帮助。
Point结构体属于System.Windows命名空间,在下文中一共展示了Point结构体的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pointInequalityExample
// Checks if two Points are equal using the overloaded inequality operator.
private Boolean pointInequalityExample()
{
// Checks if two Points are not equal using the overloaded inequality operator.
// Declaring point1 and initializing x,y values
Point point1 = new Point(10, 5);
// Declaring point2 without initializing x,y values
Point point2 = new Point();
// Boolean to hold the result of the comparison
Boolean areNotEqual;
// assigning values to point2
point2.X = 15;
point2.Y = 40;
// Compare Point structures for equality.
// areNotEqual is True
areNotEqual = (point1 != point2);
return areNotEqual;
}