Esempio n. 1
0
        internal override void DrawTextControlBackground(TextControl control, Graphics graphics, Rectangle bounds)
        {
            Size ellipse = new SizeF(9 * ScaleFactor.Width, 9 * ScaleFactor.Height).ToSize();


            using (Bitmap buffer = new Bitmap(bounds.Width, bounds.Height))
            {
                using (Graphics g = Graphics.FromImage(buffer))
                {
                    g.Clear(TextBackGround);

                    int   lineSize = Convert.ToInt32(ScaleFactor.Height);
                    Color color    = Tenor.Mobile.Drawing.Strings.ToColor("#313131");
                    using (SolidBrush brush = new SolidBrush(color))
                        using (Pen pen = new Pen(color))
                        {
                            int radius = Convert.ToInt32(ellipse.Height / 2);
                            int x      = 1;
                            int y      = 1;

                            Point[] arc = Tenor.Mobile.Drawing.Arc.CreateArc(0, -90, 200, radius, 0, 0, lineSize - 1);
                            g.DrawLines(pen, arc);

                            arc = Tenor.Mobile.Drawing.Arc.CreateArc(0, -90, 200, radius, x, y, lineSize - 1);
                            g.DrawLines(pen, arc);

                            g.FillRectangle(brush, new Rectangle(arc[0].X, y, bounds.Width - arc[0].X, lineSize));
                            int middlePoint = Convert.ToInt32((arc.Length - 1) / 2);
                            g.FillRectangle(brush, new Rectangle(x, arc[middlePoint].Y, lineSize, bounds.Height - arc[middlePoint].Y));
                        }
                }


                using (Pen p = new Pen(control.BackColor))
                    using (TextureBrush brush = new TextureBrush(buffer))
                    {
                        graphics.Clear(control.BackColor);
                        RoundedRectangle.Fill(graphics, p, brush, bounds,
                                              ellipse
                                              );
                    }
            }
        }
Esempio n. 2
0
 internal abstract void DrawTextControlBackground(TextControl control, Graphics g, Rectangle bounds);