本文整理汇总了C#中Rectangle.Move方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.Move方法的具体用法?C# Rectangle.Move怎么用?C# Rectangle.Move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rectangle
的用法示例。
在下文中一共展示了Rectangle.Move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Move
public void Move()
{
var rect = new Rectangle(1, 1, 1, 1);
Assert.AreEqual(rect, rect.Move(Point.Zero));
Assert.AreEqual(new Rectangle(2.0f, 2.0f, 1.0f, 1.0f), rect.Move(Point.One));
Assert.AreEqual(new Rectangle(-1.0f, -2.0f, 1.0f, 1.0f), rect.Move(new Point(-2, -3)));
}
示例2: Main
public static void Main(string [] args)
{
Enlightenment.Ecore.MainLoop.Init();
Enlightenment.Ecore.Canvas.Init();
EE.SoftwareX11New(":0", IntPtr.Zero, 0, 0, app_w, app_h);
EE.Title = "Sharp Table";
EE.NameClassSet("sharp_container","sharp_container");
EE.ResizeEvent += new Enlightenment.Ecore.Canvas.EventHandler(AppResizeHandler);
EE.Show();
Enlightenment.Ecore.Events.SignalExitEvent += new Enlightenment.Ecore.Events.EventHandler(AppSignalExitHandler);
Rectangle bg_rect = new Rectangle(EE.Get());
bg_rect.Move(0, 0);
bg_rect.Color = new Color(228, 226, 212, 255);
bg_rect.Resize(app_w, app_h);
bg_rect.Lower();
bg_rect.Show();
Rectangle left_toolbar = new Rectangle(EE.Get());
left_toolbar.Move(0, 0);
left_toolbar.Resize(100, app_h);
left_toolbar.Color = new Color(124, 126, 101, 200);
left_toolbar.Show();
Rectangle top_toolbar = new Rectangle(EE.Get());
top_toolbar.Move(0, 0);
top_toolbar.Resize(app_w, 50);
top_toolbar.Color = new Color(124, 126, 101, 200);
top_toolbar.Show();
DirectoryInfo myDirectory = new DirectoryInfo(args[0]);
FileInfo[] _files = myDirectory.GetFiles();
foreach (FileInfo file in _files)
{
TableImage i = new TableImage(file);
items.Add(i);
}
EE.DataSet("bg_rect", bg_rect);
EE.DataSet("left_toolbar", left_toolbar);
EE.DataSet("top_toolbar", top_toolbar);
WaitCallback callback = new WaitCallback(DrawGui);
ThreadPool.QueueUserWorkItem(callback);
Enlightenment.Ecore.MainLoop.Begin();
}
示例3: TestMove
public void TestMove()
{
Rectangle r1;
Point p1, p2;
double width=10, height=10;
/* Move corners */
p1 = new Point (0, 0);
r1 = new Rectangle (p1, width, height);
p2 = new Point (1, 1);
r1.Move (SelectionPosition.TopLeft, p2, null);
CompareRect (r1, p2, 9, 9);
p2 = new Point (9, 8);
r1.Move (SelectionPosition.BottomRight, p2, null);
CompareRect (r1, new Point (1, 1), 8, 7);
p2 = new Point (11, 2);
r1.Move (SelectionPosition.TopRight, p2, null);
CompareRect (r1, new Point (1, 2), 10, 6);
p2 = new Point (2, 9);
r1.Move (SelectionPosition.BottomLeft, p2, null);
CompareRect (r1, new Point (2, 2), 9, 7);
/* Move borders */
p1 = new Point (0, 0);
r1 = new Rectangle (p1, width, height);
p2 = new Point (3, 5);
r1.Move (SelectionPosition.Left, p2, null);
CompareRect (r1, new Point (3, 0), 7, 10);
p2 = new Point (5, 11);
r1.Move (SelectionPosition.Bottom, p2, null);
CompareRect (r1, new Point (3, 0), 7, 11);
p2 = new Point (6, 2);
r1.Move (SelectionPosition.Top, p2, null);
CompareRect (r1, new Point (3, 2), 7, 9);
p2 = new Point (8, 11);
r1.Move (SelectionPosition.Right, p2, null);
CompareRect (r1, new Point (3, 2), 5, 9);
}