本文整理汇总了C#中System.Drawing.Point类的典型用法代码示例。如果您正苦于以下问题:C# Point类的具体用法?C# Point怎么用?C# Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point类属于System.Drawing命名空间,在下文中一共展示了Point类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rectangle
/// <summary>
/// <para>
/// Initializes a new instance of the Rectangle class with the specified location
/// and size.
/// </para>
/// </summary>
public Rectangle(Point location, Size size)
{
_x = location.X;
_y = location.Y;
_width = size.Width;
_height = size.Height;
}
示例2: OnMouseDown
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
clickPoint = Cursor.Position;
this.Capture = true;
}
示例3: MarkerImage
public MarkerImage(string path, Size size, Point point, Point anchor)
{
Path = System.Web.VirtualPathUtility.ToAbsolute(path);
Size = size;
Point = point;
Anchor = anchor;
}
示例4: BaseActor
protected BaseActor(ILevelInfo info)
{
Info = info;
Position = new Point(0, 0);
IsAlive = true;
CanDrop = false;
}
示例5: initKalman
private void initKalman()
{
last = lastEst = new System.Drawing.Point();
kf = new Kalman(kfData.state,kfData.transitionMatrix, kfData.measurementMatrix,
kfData.processNoise, kfData.measurementNoise);
kf.ErrorCovariancePost = kfData.errorCovariancePost;
}
示例6: GetComeDirection
internal static IComeDirection GetComeDirection(Point user, Point ball)
{
try
{
if (user.X == ball.X && user.Y - 1 == ball.Y)
return IComeDirection.Down;
if (user.X + 1 == ball.X && user.Y - 1 == ball.Y)
return IComeDirection.DownLeft;
if (user.X + 1 == ball.X && user.Y == ball.Y)
return IComeDirection.Left;
if (user.X + 1 == ball.X && user.Y + 1 == ball.Y)
return IComeDirection.UpLeft;
if (user.X == ball.X && user.Y + 1 == ball.Y)
return IComeDirection.Up;
if (user.X - 1 == ball.X && user.Y + 1 == ball.Y)
return IComeDirection.UpRight;
if (user.X - 1 == ball.X && user.Y == ball.Y)
return IComeDirection.Right;
if (user.X - 1 == ball.X && user.Y - 1 == ball.Y)
return IComeDirection.DownRight;
return IComeDirection.Null;
}
catch
{
return IComeDirection.Null;
}
}
示例7: glCanvas1_MouseDown
private void glCanvas1_MouseDown(object sender, MouseEventArgs e)
{
this.lastMousePosition = e.Location;
this.lastMouseDownPosition = e.Location;
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
//// operate camera
//rotator.SetBounds(this.glCanvas1.Width, this.glCanvas1.Height);
//rotator.MouseDown(e.X, e.Y);
}
else if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
// move vertex
if (pickedGeometry != null)
{
ViewPort viewPort = pickedGeometry.FromViewPort;
ICamera camera = viewPort.Camera;
var dragParam = new DragParam(
camera.GetPerspectiveProjectionMatrix(),
camera.GetViewMatrix(),
viewPort.Rect.ToViewport(),
new Point(e.X, glCanvas1.Height - e.Y - 1));
dragParam.pickedVertexIds.AddRange(pickedGeometry.VertexIds);
this.dragParam = dragParam;
}
}
}
示例8: GetBounds
public Rectangle GetBounds(Point itemLocation, Size itemSize)
{
return new Rectangle((itemLocation.X + itemSize.Width) - locationFromRight.X,
itemLocation.Y,
size.Width,
size.Height);
}
示例9: Rectangle
public Rectangle(Point p, Size s)
{
X = p.X;
Y = p.Y;
Width = s.Width;
Height = s.Height;
}
示例10: PrintNew
private void PrintNew(int x, int y)
{
var point = new Point(x * scale, y * scale);
var size = new Size(scale, scale);
var rectangle = new Rectangle(point, size);
graphics.FillEllipse(Brushes.Black, rectangle);
}
示例11: SetEditingMode
/// <summary>
/// Determines the editing mode from input position.</summary>
/// <param name="p">Input position point</param>
public override void SetEditingMode(Point p)
{
if (Bounds.Contains(p))
EditingMode = EditMode.ByClick;
else
EditingMode = EditMode.None;
}
示例12: ContainsSizeChangeArea
/// <summary>
/// ポイントがD&Dするとサイズが変更されるエリア内にあるかどうかを判定します。
/// </summary>
public bool ContainsSizeChangeArea(Point p)
{
return getTop().Contains(p) ||
getBottom().Contains(p) ||
getLeft().Contains(p) ||
getRight().Contains(p);
}
示例13: BaseMain_MouseDown
private void BaseMain_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
return;
this.mouseOff = new Point(-e.X, -e.Y);
this.leftFlag = true;
}
示例14: ConvertToWindowsPointTest
public void ConvertToWindowsPointTest()
{
var point = new Point(10, 10);
System.Windows.Point winPoint = point.ConvertToWindowsPoint();
Assert.That(winPoint.X, Is.EqualTo(10));
Assert.That(winPoint.Y, Is.EqualTo(10));
}
示例15: ClickSaveConnection
public void ClickSaveConnection()
{
WpfWindow theWindow = GetNewServerWindow();
Point p = new Point(theWindow.BoundingRectangle.Left + 300, theWindow.BoundingRectangle.Top + 275);
Mouse.Move(p);
Mouse.Click();
}