示例#1
0
文件: Canvas.cs 项目: zhabis/nfx
 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);
 }
示例#2
0
文件: Canvas.cs 项目: zhabis/nfx
 /// <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));
 }
示例#3
0
文件: Canvas.cs 项目: zhabis/nfx
 public void DrawString(Canvas.Font font, Canvas.Brush brush, string text, float x, float y) => DrawString(font, brush, text, new PointF(x, y));