/// </summary>
///
/// <remarks>
- /// Creates a Point from an integer which holds the X
- /// coordinate in the high order 16 bits and the Y
+ /// Creates a Point from an integer which holds the Y
+ /// coordinate in the high order 16 bits and the X
/// coordinate in the low order 16 bits.
/// </remarks>
public Point (int dw)
{
- x = dw >> 16;
- y = dw & 0xffff;
+ y = dw >> 16;
+ x = unchecked ((short) (dw & 0xffff));
}
/// <summary>
return string.Format ("{{X={0},Y={1}}}", x.ToString (CultureInfo.InvariantCulture),
y.ToString (CultureInfo.InvariantCulture));
}
-#if NET_2_0
public static Point Add (Point pt, Size sz)
{
return new Point (pt.X + sz.Width, pt.Y + sz.Height);
{
return new Point (pt.X - sz.Width, pt.Y - sz.Height);
}
-#endif
}
}