DrawText() публичный Метод

Paint some text over the active viewport at the indicated position and color
public DrawText ( string text, Rectangle rect, System color ) : void
text string A string containing the text to show
rect System.Drawing.Rectangle
color System Color for the text
Результат void
Пример #1
0
        internal void Paint(Device device)
        {
            if (hoverItem != null)
            {
                // Glow item
                if (hoverItem is LineElement)
                {
                    LineElement line = hoverItem as LineElement;

                    Model.Model model      = Model.Model.Instance;
                    GraphicView activeView = GraphicViewManager.Instance.ActiveView;
                    View.Renderer.RenderOptions options = activeView.ModelRenderer.RenderOptions;

                    if (options.ShowDeformed && model.HasResults && curve != null)
                    {
                        for (int i = 0; i < curve.Length - 1; i++)
                        {
                            hoverPainter.PaintLine(device, curve[i], curve[i + 1]);
                        }
                    }
                    else
                    {
                        hoverPainter.PaintLine(device, line);
                    }
                }

                // Show hoverPos
                Vector3 hoverPos2D = hoverPos;
                GraphicViewManager.Instance.ActiveView.Project(ref hoverPos2D);
                hoverPainter.PaintPoint(device, hoverPos2D);

                if (showingTooltip && !string.IsNullOrEmpty(tooltipText))
                {
                    // Draw tooltip rectangle
                    rectHelper.Paint(device);

                    // Draw text
                    Rectangle rect = tooltipRectangle;
                    rect.X += 4;
                    rect.Y += 2;
                    hoverPainter.DrawText(tooltipText, rect, GraphicViewManager.Instance.PrintingHiResImage ? Color.Black : Color.White);
                }
            }
        }