/// <summary> /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object. /// </summary> /// <param name="s">String to draw.</param> /// <param name="font">Font object that defines the text format of the string.</param> /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param> /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param> /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param> internal void DrawString( string s, Font font, Brush brush, PointF point, StringFormat format ) { if (IsRightToLeft) { using (StringFormat fmt = (StringFormat)format.Clone()) { fmt.FormatFlags |= StringFormatFlags.DirectionRightToLeft; if (fmt.Alignment == StringAlignment.Far) { fmt.Alignment = StringAlignment.Near; } else if (fmt.Alignment == StringAlignment.Near) { fmt.Alignment = StringAlignment.Far; } RenderingObject.DrawString(s, font, brush, point, fmt); } } else { RenderingObject.DrawString(s, font, brush, point, format); } }
/// <summary> /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object. /// </summary> /// <param name="s">String to draw.</param> /// <param name="font">Font object that defines the text format of the string.</param> /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param> /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param> /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param> internal void DrawString( string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format ) { using (StringFormat fmt = (StringFormat)format.Clone()) { if (IsRightToLeft) { fmt.FormatFlags |= StringFormatFlags.DirectionRightToLeft; } if (!IsTextClipped && (fmt.FormatFlags & StringFormatFlags.NoClip) != StringFormatFlags.NoClip) { fmt.FormatFlags |= StringFormatFlags.NoClip; } RenderingObject.DrawString(s, font, brush, layoutRectangle, fmt); } }
public void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format) { RenderingObject.DrawString(s, font, brush, point, format); }
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) { RenderingObject.DrawString(s, font, brush, layoutRectangle, format); }