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


C# DrawingContext.DrawRectangleGuided方法代码示例

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


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

示例1: DrawColumnHeaders

		/// <summary>
		/// Draws all column header
		/// </summary>
		/// <param name="dc"></param>
		void DrawColumnHeaders(DrawingContext dc)
		{           
			double curX = RowSelectionButtonWidth + 1 - scrollXOffset;
			for (int colIdx = 0; colIdx < ColumnList.Count; colIdx++)
			{
				//drawingContext.DrawLine(myPen, new Point(curX, 0), new Point(curX, this.Height));
				DrawColumnHeader(dc, colIdx, new Rect(curX, 0, ColumnList[colIdx].Width, ColumnHeaderHeight));
				curX += ColumnList[colIdx].Width + 1;
			}

			// Check if rest table header (right) must be dawn
			if (curX < Width)
			{
				dc.DrawRectangleGuided(ColumnHeaderDefaultBackgroundBrush, null, new Rect(curX, 0, Width - curX, ColumnHeaderHeight));
				dc.DrawLineGuided(smallGrayPen, curX, ColumnHeaderHeight, curX + Width - curX, ColumnHeaderHeight);
			}
		}
开发者ID:JPlenert,项目名称:Pro1,代码行数:21,代码来源:SmartTableControl.cs

示例2: DrawRowSelectionButton

		/// <summary>
		/// Draws a selection button right to the first data column.
		/// In the default case the right and button line will be drawn by this method.
		/// The size of the drawrect is not including this both lines.
		/// </summary>
		/// <param name="dc"></param>
		/// <param name="rowIdx"></param>
		/// <param name="drawRect"></param>
		void DrawRowSelectionButton(DrawingContext dc, int rowIdx, Rect drawRect)
		{
			Brush backgroundBrush;

			// Get Bk-Color
			backgroundBrush = OnGetBackgroundBrush(-1, rowIdx);

			dc.DrawRectangleGuided(backgroundBrush, null, drawRect);
			dc.DrawLineGuided(smallLLtGrayToGrayHPen, drawRect.Left, drawRect.Bottom, drawRect.Right+1, drawRect.Bottom);
			dc.DrawLineGuided(smallGrayPen, drawRect.TopRight, drawRect.BottomRight);
		}
开发者ID:JPlenert,项目名称:Pro1,代码行数:19,代码来源:SmartTableControl.cs

示例3: DrawCell

		/// <summary>
		/// Draws a data cell 
		/// In the default case the right and button line will be drawn by this method.
		/// The size of the drawrect is not including this both lines.
		/// </summary>
		/// <param name="dc"></param>
		/// <param name="cell"></param>
		/// <param name="colIdx"></param>
		/// <param name="rowIdx"></param>
		/// <param name="drawRect"></param>
		void DrawCell(DrawingContext dc, Cell cell, int colIdx, int rowIdx, Rect drawRect)
		{
			Brush backgroundBrush;
			string cellText;
			Column column = ColumnList[colIdx];
			Rect textRect;

			// Get Bk-Color
			backgroundBrush = OnGetBackgroundBrush(colIdx, rowIdx);

			// Get Text
			cellText = OnGetCellText(colIdx, rowIdx);

			dc.DrawRectangleGuided(backgroundBrush, null, drawRect);
			dc.DrawLineGuided(smallLtGrayPen, drawRect.Left, drawRect.Bottom, drawRect.Right + 1, drawRect.Bottom);
			dc.DrawLineGuided(smallLtGrayPen, drawRect.Right, drawRect.Top, drawRect.Right, drawRect.Bottom);

			textRect = new Rect(drawRect.Left + ColumnHeaderMargin.Left, drawRect.Top + ColumnHeaderMargin.Top, drawRect.Width - (ColumnHeaderMargin.Left + ColumnHeaderMargin.Right), drawRect.Height - (ColumnHeaderMargin.Top + ColumnHeaderMargin.Bottom));

			FormattedText text = new FormattedText(cellText, System.Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Arial"), 12, Brushes.Black);
			text.MaxTextWidth = textRect.Width;
			text.Trimming = TextTrimming.None;
			text.MaxLineCount = 1;
			dc.DrawText(text, new Point(textRect.Left + (textRect.Width - text.Width) / 2, drawRect.Top + ColumnHeaderMargin.Top));
		}
开发者ID:JPlenert,项目名称:Pro1,代码行数:35,代码来源:SmartTableControl.cs

示例4: DrawCornerBox

		/// <summary>
		/// Draws the box in the upper left corner (pos -1, -1)
		/// </summary>
		/// <param name="dc"></param>
		void DrawCornerBox(DrawingContext dc)
		{
			Brush backgroundBrush;
			Rect drawRect;

			drawRect = new Rect(0, 0, RowSelectionButtonWidth, ColumnHeaderHeight);

			// Get Bk-Color
			backgroundBrush = OnGetBackgroundBrush(-1, -1);

			dc.DrawRectangleGuided(backgroundBrush, null, drawRect);
			dc.DrawLineGuided(smallLLtGrayToGrayVPen, drawRect.Right, drawRect.Top, drawRect.Right, drawRect.Bottom + 1);
			dc.DrawLineGuided(smallLLtGrayToGrayHPen, drawRect.BottomLeft, drawRect.BottomRight);
		}
开发者ID:JPlenert,项目名称:Pro1,代码行数:18,代码来源:SmartTableControl.cs


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