本文整理汇总了C#中IGraphics.HintTextBackgroundAction方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphics.HintTextBackgroundAction方法的具体用法?C# IGraphics.HintTextBackgroundAction怎么用?C# IGraphics.HintTextBackgroundAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphics
的用法示例。
在下文中一共展示了IGraphics.HintTextBackgroundAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
void Draw(IGraphics g, DrawingMode mode)
{
g.SmoothingMode = checkBoxAntialiasing.Checked ? SmoothingMode.HighQuality : SmoothingMode.None;
g.Clear(Color.White);
DrawMillimeterGridInPixels(g, tabControl1.SelectedTab.Controls[0].ClientRectangle);
g.PageUnit = GraphicsUnit.Millimeter;
var points = _noisePoints;
DrawLines(g, points, mode);
g.ResetTransform();
var path = CreateRoundedRectanglePath(new RectangleF(10, 10, 100, 40), 10);
g.FillPath(new SolidBrush(Color.FromArgb(120, Color.LightSlateGray)), path);
g.DrawPath(new Pen(Color.LightSlateGray, 0.0f), path);
g.FillPie(new SolidBrush(Color.FromArgb(120, Color.CadetBlue)), new Rectangle(30, 20, 100, 100), 45.0f, 90.0f);
g.DrawPie(new Pen(Color.CadetBlue, 0.0f), new Rectangle(30, 20, 100, 100), 45.0f, 90.0f);
//GLGraphics gl = g as GLGraphics;
//if (gl != null)
// gl.FillTextBackground = gl.FillTextBackground_glReadPixels;
g.PageUnit = GraphicsUnit.Pixel;
RectangleF rect = new RectangleF(30.0f, 15.0f, _testImage.Width, _testImage.Height);
g.DrawImage(_testImage, rect);
g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
g.PageUnit = GraphicsUnit.Millimeter;
g.HintTextBackgroundAction((gdi, textLocation, textRect) =>
{
_millimeterGridBrush.ResetTransform();
_millimeterGridBrush.TranslateTransform(-textLocation.X, -textLocation.Y);
gdi.FillRectangle(_millimeterGridBrush, textRect);
});
g.DrawString("Testovací řetězec pro odzkoušení správné implementace IGraphics - metody DrawString.",
new Font("Arial", 12.0f), Brushes.Black, new PointF(100.0f, 58.0f));
}