本文整理汇总了C#中Altaxo.PaintBackground方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.PaintBackground方法的具体用法?C# Altaxo.PaintBackground怎么用?C# Altaxo.PaintBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo
的用法示例。
在下文中一共展示了Altaxo.PaintBackground方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RowHeaderStyle_Paint
private static void RowHeaderStyle_Paint(Altaxo.Worksheet.RowHeaderStyle thiss, object drawingContext, RectangleD2D cellRect, int nRow, Altaxo.Data.DataColumn data, bool bSelected)
{
var dc = (DrawingContext)drawingContext;
Rect cellRectangle = cellRect.ToWpf();
thiss.PaintBackground(dc, cellRect, bSelected);
string text = "[" + nRow + "]";
var font = WpfFontManager.ToWpf(thiss.TextFont);
var fontSize = (thiss.TextFont.Size * 96) / 72;
var txtBrush = bSelected ? thiss.DefaultSelectedTextBrush.ToWpf() : thiss.TextBrush.ToWpf();
FormattedText t;
t = new FormattedText(text, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, font, fontSize, txtBrush);
t.MaxTextWidth = cellRectangle.Width;
t.TextAlignment = TextAlignment.Center;
dc.DrawText(t, cellRectangle.Location); // ("[" + nRow + "]", _textFont, _textBrush, cellRectangle, _textFormat);
}
示例2: ColumnHeaderStyle_Paint
private static void ColumnHeaderStyle_Paint(Altaxo.Worksheet.ColumnHeaderStyle thiss, object drawingContext, RectangleD2D cellRect, int nRow, Altaxo.Data.DataColumn data, bool bSelected)
{
var dc = (DrawingContext)drawingContext;
Rect cellRectangle = cellRect.ToWpf();
thiss.PaintBackground(dc, cellRect, bSelected);
Altaxo.Data.DataColumnCollection dataColCol = (Altaxo.Data.DataColumnCollection)AbsoluteDocumentPath.GetRootNodeImplementing(data, typeof(Altaxo.Data.DataColumnCollection));
string columnnumber = dataColCol.GetColumnNumber(data).ToString();
string kindandgroup = string.Format("({0}{1})", dataColCol.GetColumnKind(data).ToString(), dataColCol.GetColumnGroup(data));
var font = WpfFontManager.ToWpf(thiss.TextFont);
var fontSize = (thiss.TextFont.Size * 96) / 72;
var fontheight = font.FontFamily.LineSpacing * fontSize;
var nameRectangle = cellRectangle;
nameRectangle.Height = Math.Max(fontheight, cellRectangle.Height - fontheight);
var numRectangle = cellRectangle;
numRectangle.Height = fontheight;
numRectangle.Y = Math.Max(cellRectangle.Y + cellRectangle.Height - fontheight, cellRectangle.Y);
var txtBrush = bSelected ? thiss.DefaultSelectedTextBrush.ToWpf() : thiss.TextBrush.ToWpf();
FormattedText t;
t = new FormattedText(columnnumber, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, font, fontSize, txtBrush);
t.MaxTextWidth = numRectangle.Width;
t.TextAlignment = TextAlignment.Left;
dc.DrawText(t, numRectangle.Location);
t = new FormattedText(kindandgroup, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, font, fontSize, txtBrush);
t.MaxTextWidth = numRectangle.Width;
t.TextAlignment = TextAlignment.Right;
dc.DrawText(t, numRectangle.Location);
t = new FormattedText(data.Name, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, font, fontSize, txtBrush);
t.MaxTextWidth = nameRectangle.Width;
t.TextAlignment = TextAlignment.Center;
dc.DrawText(t, nameRectangle.Location);
}
示例3: GeneralText_Paint
private static void GeneralText_Paint(Altaxo.Worksheet.ColumnStyle thiss, object drawingContext, RectangleD2D cellRect, string textToDraw, TextAlignment alignment, bool bSelected)
{
var dc = (DrawingContext)drawingContext;
Rect cellRectangle = cellRect.ToWpf();
thiss.PaintBackground(dc, cellRect, bSelected);
var font = WpfFontManager.ToWpf(thiss.TextFont);
var fontSize = (thiss.TextFont.Size * 96) / 72;
var txtBrush = bSelected ? thiss.DefaultSelectedTextBrush.ToWpf() : thiss.TextBrush.ToWpf();
FormattedText t;
t = new FormattedText(textToDraw, System.Globalization.CultureInfo.InvariantCulture, FlowDirection.LeftToRight, font, fontSize, txtBrush);
t.MaxTextWidth = cellRect.Width;
t.TextAlignment = alignment;
t.Trimming = TextTrimming.CharacterEllipsis;
dc.DrawText(t, cellRectangle.Location);
}