Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 /// <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));
 }
Esempio n. 3
0
 public void DrawString(Canvas.Font font, Canvas.Brush brush, string text, float x, float y) => DrawString(font, brush, text, new PointF(x, y));