本文整理汇总了C#中Rectangle.Resize方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.Resize方法的具体用法?C# Rectangle.Resize怎么用?C# Rectangle.Resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rectangle
的用法示例。
在下文中一共展示了Rectangle.Resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Given_a_ratio_that_will_result_in_a_non_integer_value_it_will_round_down
public void Given_a_ratio_that_will_result_in_a_non_integer_value_it_will_round_down()
{
var subject = new Rectangle(99, 99);
var result = subject.Resize(0.5);
Assert.True(result.Height == 49 && result.Width == 49);
}
示例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: Given_a_ratio_of_half_it_should_half_each_side
public void Given_a_ratio_of_half_it_should_half_each_side()
{
var subject = new Rectangle(100, 100);
var result = subject.Resize(0.5);
Assert.True(result.Height == 50 && result.Width == 50);
}