System.Drawing.Drawing2D.GraphicsPath.AddString C# (CSharp) Method

AddString() public method

public AddString ( string s, FontFamily family, int style, float emSize, Point origin, StringFormat format ) : void
s string
family FontFamily
style int
emSize float
origin Point
format StringFormat
return void
        public void AddString(string s,	FontFamily family,	int style, float emSize, Point origin, StringFormat format)
        {
            var font = new Font (family.Name, emSize, (FontStyle)style);
            var layoutRect = RectangleF.Empty;
            layoutRect.Location = origin;
            NativeDrawString (s, font, Color.Red, layoutRect, format);
        }

Same methods

GraphicsPath::AddString ( string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format ) : void
GraphicsPath::AddString ( string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format ) : void
GraphicsPath::AddString ( string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format ) : void

Usage Example

Exemplo n.º 1
1
        static GraphicsPath GetStringPath(string s, float dpi, Point p, Font font, StringFormat format)
        {
            GraphicsPath path = new GraphicsPath();
            // Convert font size into appropriate coordinates
            float emSize = dpi * font.SizeInPoints / 72;
            path.AddString(s, font.FontFamily, (int)font.Style, emSize, p, format);

            return path;
        }
All Usage Examples Of System.Drawing.Drawing2D.GraphicsPath::AddString