本文整理汇总了C#中System.Drawing.RectangleF.ToRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# RectangleF.ToRectangle方法的具体用法?C# RectangleF.ToRectangle怎么用?C# RectangleF.ToRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.RectangleF
的用法示例。
在下文中一共展示了RectangleF.ToRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillRectangle
public override void FillRectangle(Brush brush, RectangleF rect)
{
SetPatternFromBrush(brush);
if (brush is TextureBrush)
{
_canvas.CurrentColor = Color.White;
_canvas.Texture2DEnabled = true;
TextureBrush textureBrush = (TextureBrush)brush;
var texture = GetCachedTexture(textureBrush);
texture.DrawTiled(rect.ToRectangle());
_canvas.Texture2DEnabled = false;
}
else
{
_canvas.FillRectangle(rect, ColorsFromBrush(brush));
}
_canvas.ResetPolygonStipplePattern();
}
示例2: DrawRectangle
private static void DrawRectangle(Graphics g, String prefixtext, RectangleF drawthis, Pen RectPen, Brush RectBrush,
Brush TextBrush, Font usefont)
{
g.FillRectangle(RectBrush, drawthis);
g.DrawRectangle(RectPen, drawthis.ToRectangle());
//also paint coordinate information.
//cachestate.Blocks.Count.ToString() + " Blocks;\n"
String BlockInfotext = prefixtext +
"(" + Math.Round(drawthis.Left, 1) + "," + Math.Round(drawthis.Top, 1) + ")-(" +
"(" + Math.Round(drawthis.Right, 1) + "," + Math.Round(drawthis.Bottom, 1) + ")";
Size measurestring = TextRenderer.MeasureText(g, BlockInfotext, usefont);
Point getcenter = drawthis.CenterPoint().ToPoint();
Point DrawHere = new Point(getcenter.X - measurestring.Width / 2, getcenter.Y - measurestring.Height / 2);
g.DrawString(BlockInfotext, usefont, TextBrush, DrawHere.X, DrawHere.Y);
}