Esempio n. 1
0
        protected void Draw(GraphicsAPI graphics, Font font, Brush brush, string s, Rectangle r)
        {
            Point marginsAlignment = this.GetMarginsAlignment(font, graphics);

            if (this.AlignmentHorizontal.Style == StringAlignment.Near)
            {
                r.Offset(marginsAlignment.X, 0);
            }
            else if (this.AlignmentHorizontal.Style == StringAlignment.Far)
            {
                r.Offset(-marginsAlignment.X, 0);
            }
            if (this.AlignmentVertical.Style == StringAlignment.Near)
            {
                r.Offset(0, marginsAlignment.Y);
            }
            else if (this.AlignmentVertical.Style == StringAlignment.Far)
            {
                r.Offset(0, -marginsAlignment.Y);
            }
            graphics.DrawString(s, font, brush, r, this.StringFormat);
        }
Esempio n. 2
0
 public PaintArgs(Graphics graphics, Rectangle r, Color color)
 {
     this.m_ControlBackColor = color;
     this.m_Graphics         = new GraphicsAPI(graphics);
     this.SetRectangle(r);
 }
Esempio n. 3
0
 Point ITextLayoutBase.GetMarginsAlignment(Font font, GraphicsAPI graphics)
 {
     return(this.GetMarginsAlignment(font, graphics));
 }
Esempio n. 4
0
 Rectangle ITextLayoutBase.GetRectangle(string s, Point pt, Font font, GraphicsAPI graphics)
 {
     return(this.GetRectangle(s, pt, font, graphics));
 }
Esempio n. 5
0
 Rectangle ITextLayoutBase.GetRectangle(Rectangle bounds, Font font, GraphicsAPI graphics)
 {
     return(this.GetRectangle(bounds, font, graphics));
 }
Esempio n. 6
0
 Size ITextLayoutBase.GetRequiredSize(string s, Font font, int width, GraphicsAPI graphics)
 {
     return(this.GetRequiredSize(s, font, width, graphics));
 }
Esempio n. 7
0
 void ITextLayoutBase.Draw(GraphicsAPI graphics, Font font, Brush brush, string s, Rectangle r)
 {
     this.Draw(graphics, font, brush, s, r);
 }
Esempio n. 8
0
        private Point GetMarginOffsets(Font font, GraphicsAPI graphics)
        {
            int x = (int)Math.Ceiling((double)graphics.MeasureString("0", font, true).Width *this.Alignment.Margin);

            return(new Point(x, 0));
        }
Esempio n. 9
0
 Size ITextLayoutHorizontal.GetRequiredSize(string s, Font font, GraphicsAPI graphics)
 {
     return(this.GetRequiredSize(s, font, graphics));
 }
Esempio n. 10
0
 Point ITextLayoutHorizontal.GetMarginOffsets(Font font, GraphicsAPI graphics)
 {
     return(this.GetMarginOffsets(font, graphics));
 }