public void DrawString(Canvas.Font font, Canvas.Brush brush, string text, PointF p) { if (font == null || brush == null || text == null) { throw new GraphicsException(StringConsts.ARGUMENT_ERROR + "{0}.{1}(font|brush|text=null)".Args(nameof(Canvas), nameof(DrawString))); } EnsureObjectNotDisposed(); m_Handle.DrawString(font.Handle, brush.Handle, text, p); }
/// <summary> /// Measures the size of text rendered in the font within the optional bounds /// </summary> public SizeF MeasureString(Canvas.Font font, string text, SizeF?bounds) { if (font == null || text == null) { throw new GraphicsException(StringConsts.ARGUMENT_ERROR + "{0}.{1}(font=null)".Args(nameof(Canvas), nameof(MeasureString))); } EnsureObjectNotDisposed(); return(m_Handle.MeasureString(font.Handle, text, bounds)); }
public void DrawString(Canvas.Font font, Canvas.Brush brush, string text, float x, float y) => DrawString(font, brush, text, new PointF(x, y));