本文整理汇总了C#中IGraphic.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphic.DrawRectangle方法的具体用法?C# IGraphic.DrawRectangle怎么用?C# IGraphic.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphic
的用法示例。
在下文中一共展示了IGraphic.DrawRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowTowerShopPage
/// <summary>
/// Shows the tower shop page.
/// </summary>
/// <param name="graphObject">Graphic render object</param>
private void ShowTowerShopPage(IGraphic graphObject)
{
ShopPageAction((int i, int j, int offset, int xMouse, int yMouse) =>
{
graphObject.DrawImage(_towerIcons[(CurrentShopPage - 1) * (Settings.LinesInOnePage * Settings.MaxTowersInLine) + offset],
BuildRectPage(i, j));
if (TowerConfSelectedID == (CurrentShopPage - 1) * (Settings.LinesInOnePage * Settings.MaxTowersInLine) + offset)
//Border line
graphObject.DrawRectangle(new Pen(Color.Red, Settings.PenWidth * Scaling), BuildRectPage(i, j));
return false;
});
}
示例2: ShowPageSelector
/// <summary>
/// Shows the page selector.(Pages in shop)
/// </summary>
/// <param name="graphObject">Graphic render object</param>
private void ShowPageSelector(IGraphic graphObject)
{
if (_towerIcons.Count > Settings.LinesInOnePage * Settings.MaxTowersInLine)
{
ShopPageSelectorAction((int i, int dy, int xMouse, int yMouse) =>
{
//String
graphObject.DrawString("Page " + (i + 1).ToString(CultureInfo.InvariantCulture), new Font("Arial", 14 * Scaling), new SolidBrush(Color.Black),
new Point(
Convert.ToInt32((_paginatorPos.X + (i % ElementsDelta) * ("Page " + (i + 1).ToString(CultureInfo.InvariantCulture)).Length * Settings.PixelsForOneSymbol) * Scaling),
Convert.ToInt32((_paginatorPos.Y + PaginatorElementHeight * dy) * Scaling)));
//Border line
Color penColor = ((i + 1) == CurrentShopPage) ? Color.Red : Color.White;
graphObject.DrawRectangle(new Pen(penColor, Settings.PenWidth * Scaling), BuildRectPageSelector(i, dy));
return false;
});
}
}