本文整理汇总了C#中Graphic.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Graphic.DrawRectangle方法的具体用法?C# Graphic.DrawRectangle怎么用?C# Graphic.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphic
的用法示例。
在下文中一共展示了Graphic.DrawRectangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Graphic g)
{
var pos = (_c.Position + _c.Margin.TopLeft) * _c.Scale;
g.DrawRectangle(pos, _c.Size * _c.Scale, true, Style.Background);
g.DrawRectangle(pos, _c.Size * _c.Scale, false, ForegroundColor);
g.DrawRectangle(pos, _c.Size.Width * _c.Current * _c.Scale, _c.Size.Height * _c.Scale, true, ForegroundColor);
}
示例2: Draw
public override void Draw(Graphic g)
{
g.DrawRectangle((_c.Position + _c.Margin.TopLeft) * _c.Scale, _c.Size * _c.Scale, false, ForegroundColor);
if (!_c.Value)
return;
var size = _c.Size * .5f;
var position = _c.Position + ((_c.Size - size).ToVector2() / 2) + _c.Margin.TopLeft;
g.DrawRectangle(position * _c.Scale, size * _c.Scale, true, ForegroundColor);
}
示例3: Draw
public override void Draw(Graphic g)
{
var position = _c.Position * _c.Scale;
var size = _c.Size * _c.Scale;
g.DrawRectangle(position, size, true, Style.Background);
}
示例4: Draw
public override void Draw(Graphic g)
{
g.DrawRectangle(_control.Bounds, true, ForegroundColor);
}