Exemplo n.º 1
0
 public SizeF MeasureString(string text, DUIFont font, float width, float height)
 {
     if (string.IsNullOrWhiteSpace(text))
     {
         return(SizeF.Empty);
     }
     return(this.iDUIGraphics.MeasureString(text, font, width, height));
 }
Exemplo n.º 2
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     if (string.IsNullOrWhiteSpace(s))
     {
         return;
     }
     this.iDUIGraphics.DrawString(s, font, brush, layoutRectangle, format);
 }
Exemplo n.º 3
0
 public SizeF MeasureString(string text, DUIFont font, float width, float height)
 {
     using (SharpDX.DirectWrite.TextLayout tl = DxConvert.ToTextLayout(font, text))
     {
         float w = tl.Metrics.WidthIncludingTrailingWhitespace;
         float h = tl.Metrics.Height;
         return(new SizeF(w, h));
     }
 }
Exemplo n.º 4
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     brush.RenderTarget = this.target;
     try
     {
         this.target.RenderTarget.DrawText(s, font, DxConvert.ToRectF(new RectangleF(layoutRectangle.X, layoutRectangle.Y, float.MaxValue, 0)), brush);
     }
     catch (Exception ex)
     {
         Log.DUILog.GettingLog(ex);
         //这里报错率很高,但不知道为什么
     }
 }
Exemplo n.º 5
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     this.graphics.DrawString(s, font, brush, layoutRectangle, format);
 }
Exemplo n.º 6
0
 public SizeF MeasureString(string text, DUIFont font, float width, float height)
 {
     return(this.graphics.MeasureString(text, font, new SizeF(width, height)));
 }
Exemplo n.º 7
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, float x, float y)
 {
     DrawString(s, font, brush, new RectangleF(new PointF(x, y), MeasureString(s, font)), StringFormat.GenericDefault);
 }
Exemplo n.º 8
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, PointF p)
 {
     DrawString(s, font, brush, p.X, p.Y);
 }
Exemplo n.º 9
0
 public SizeF MeasureString(string text, DUIFont font, SizeF size)
 {
     return(this.MeasureString(text, font, size.Width, size.Height));
 }
Exemplo n.º 10
0
 public SizeF MeasureString(string text, DUIFont font)
 {
     return(this.MeasureString(text, font, float.MaxValue, 0));
 }
Exemplo n.º 11
0
 public static SharpDX.DirectWrite.TextLayout ToTextLayout(DUIFont font, string text)
 {
     return(new SharpDX.DirectWrite.TextLayout(directWriteFactory, text, font, float.MaxValue, 0));
 }