Exemplo n.º 1
0
 public Area()
 {
     RectangleBrush = new SolidBrush(Color.FromArgb(100, Color.CornflowerBlue));
     RectanglePen = new Pen(Color.Black, 1);
     TextFont = new XFont("Arial", 14);
     TextBrush = new SolidBrush(Color.White);
     TextShadowBrush = new SolidBrush(Color.Black);
     TextOffset = 5;
 }
        private void DrawHelpText(Graphics g)
        {
            if (Engine.ConfigUI.FreehandCropShowHelpText)
            {
                g.CompositingMode = CompositingMode.SourceOver;
                g.SmoothingMode = SmoothingMode.HighSpeed;

                using (Font helpTextFont = new XFont("Arial", 10))
                {
                    Size textSize = Size.Round(g.MeasureString(helpText, helpTextFont, 500, StringFormat.GenericTypographic));
                    Point textPos = PointToClient(new Point(this.Left + (this.Width / 2) - ((textSize.Width + 10) / 2), this.Top + 30));
                    Rectangle labelRect = new Rectangle(textPos, new Size(textSize.Width + 10, textSize.Height + 10));
                    using (GraphicsPath gPath = GraphicsEx.GetRoundedRectangle(labelRect, 7))
                    {
                        g.FillPath(new SolidBrush(Color.FromArgb(200, Color.White)), gPath);
                        g.DrawPath(Pens.Black, gPath);
                        g.DrawString(helpText, helpTextFont, Brushes.Black, new PointF(labelRect.X + 5, labelRect.Y + 5));
                    }
                }
            }
        }