/// <summary> /// /// </summary> /// <param name="text"></param> /// <param name="font"></param> /// <param name="width"></param> /// <param name="format"></param> /// <returns></returns> public SizeF MeasureString(string text, Font2 font, int width, StringFormat2 format) { TextFormatFlags flags = new TextFormatFlags(); if (format != null) { switch (format.Alignment) { case StringAlignment2.Center: flags = TextFormatFlags.HorizontalCenter; break; case StringAlignment2.Near: flags = TextFormatFlags.Left | TextFormatFlags.Top; break; case StringAlignment2.Far: flags = TextFormatFlags.Right | TextFormatFlags.Bottom; break; } } return(TextRenderer.MeasureText(text, GraphUtils.ToFont(font), new Size(width, font.Height), flags)); }
public Size2 MeasureString(string text, Font2 font, float width) { return(GraphUtils.ToSizeF2(TextRenderer.MeasureText(text, GraphUtils.ToFont(font)))); }
public Size2 MeasureString(string text, Font2 font, float width) { return(GraphUtils.ToSizeF2(gc.MeasureString(text, GraphUtils.ToFont(font), (int)width))); }
public void DrawString(string s, Font2 font, Brush2 brush, Point2 point, StringFormat2 format) { gc.DrawString(s, GraphUtils.ToFont(font), GetBrush(brush), GraphUtils.ToPointF(point), GraphUtils.ToStringFormat(format)); }
public void DrawString(string s, Font2 font, Brush2 brush, Rectangle2 rectangleF) { gc.DrawString(s, GraphUtils.ToFont(font), GetBrush(brush), ToRectangleF(rectangleF)); }
public void DrawString(string s, Font2 font, Brush2 brush, Point2 location) { gc.DrawString(s, GraphUtils.ToFont(font), GetBrush(brush), GraphUtils.ToPointF(location)); }
public void DrawString(string s, Font2 font, Brush2 brush, float x, float y) { gc.DrawString(s, GraphUtils.ToFont(font), GetBrush(brush), x, y); }
public Size2 MeasureString(string text, Font2 font) { return(GraphUtils.ToSizeF2(gc.MeasureString(text, GraphUtils.ToFont(font)))); }