本文整理汇总了C#中Canvas.DrawProgressBar方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.DrawProgressBar方法的具体用法?C# Canvas.DrawProgressBar怎么用?C# Canvas.DrawProgressBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Canvas
的用法示例。
在下文中一共展示了Canvas.DrawProgressBar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRender
public override void OnRender(Canvas c)
{
if ((_font != null) && !Hide)
{
c.DrawFillRect(_client_area, _background_material);
_slider_area.Width = _client_area.Width - 18;
_slider_area.Height = Height;
_txt_area = _font.MeasureString(null, _percent, DrawTextFormat.None, ForegroundColor);
_font.DrawText(null, _percent, _client_area, DrawTextFormat.Center | DrawTextFormat.Top, ForegroundColor);
_left_arrow.X = _client_area.Left;
_left_arrow.Y = _client_area.Y + _txt_area.Height + 1;
_left_arrow.Width = 8;
_left_arrow.Height = _slider_area.Height;
c.DrawFillTri(_left_arrow, _arrow_material, DIRECTION.LEFT);
_slider_area.X = _left_arrow.Right + 1;
_slider_area.Y = _client_area.Y + _txt_area.Height + 1;
c.DrawProgressBar(_slider_area, _slider_background_material, _slider_foreground_material, _slider_position);
_right_arrow.X = _slider_area.Right + 1;
_right_arrow.Y = _client_area.Y + _txt_area.Height + 1;
_right_arrow.Width = 8;
_right_arrow.Height = _slider_area.Height;
c.DrawFillTri(_right_arrow, _arrow_material, DIRECTION.RIGHT);
c.DrawRect(_client_area, BorderColor);
}
}
示例2: OnRender
public override void OnRender(Canvas c)
{
c.DrawProgressBar(_client_area, _background_color_material, _progress_color_material, Progress);
_font.DrawText(null, _text, ClientArea, DrawTextFormat.VerticalCenter | DrawTextFormat.Center, ForegroundColor);
c.DrawRect(_client_area, BorderColor);
}