当前位置: 首页>>代码示例>>C#>>正文


C# ICanvas.DrawRectangle方法代码示例

本文整理汇总了C#中ICanvas.DrawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# ICanvas.DrawRectangle方法的具体用法?C# ICanvas.DrawRectangle怎么用?C# ICanvas.DrawRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICanvas的用法示例。


在下文中一共展示了ICanvas.DrawRectangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawTextBox

		void DrawTextBox (ICanvas c, string text, Point point, Font f)
		{
			var b = new SolidBrush (Colors.Black);
			var bp = new Pen (Colors.Blue);
			var rp = new Pen (Colors.Red);
			var size = c.MeasureText (text, f);
			c.DrawRectangle (new Rect (point, size.Size) + new Size (0, -size.Ascent), bp);
			c.DrawLine (point, point + new Size (size.Width, 0), rp);
			c.DrawText (text, point, f, b);
		}
开发者ID:michaelstonis,项目名称:NGraphics,代码行数:10,代码来源:TextTests.cs

示例2: DrawElement

 protected override void DrawElement(ICanvas canvas)
 {
     canvas.DrawRectangle(frame, Pen, Brush);
 }
开发者ID:JoshuaNovak919,项目名称:NGraphics,代码行数:4,代码来源:Rectangle.cs

示例3: Draw

 public override void Draw(ICanvas canvas, Rect rect)
 {
     // base.Draw(canvas, rect);
     canvas.DrawLine(rect.Left, rect.Top, rect.Width, rect.Top, _custLineColour, 3);
     canvas.DrawLine(rect.Left, rect.Height, rect.Width, rect.Height, _custLineColour, 3);
     var font = new Font {Size = 20};
     var pen = new Pen(Colors.Blue, width: 10);
     var brush = new SolidBrush(Colors.White);
     canvas.DrawRectangle(new Point(20, 20), new Size(20), pen, brush);
     //canvas.DrawText("B", rect, font, TextAlignment.Center, pen);
 }
开发者ID:wislon,项目名称:xam-draw-stuff,代码行数:11,代码来源:App.cs

示例4: DrawElement

 /// <summary>
 /// Draws the element.
 /// </summary>
 /// <param name="canvas">Canvas.</param>
 protected override void DrawElement(ICanvas canvas)
 {
     canvas.DrawRectangle(frame, Pen?.Clone(), Brush?.Clone());
 }
开发者ID:yard,项目名称:NGraphics,代码行数:8,代码来源:Rectangle.cs


注:本文中的ICanvas.DrawRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。