Esempio 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));
 }
Esempio 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);
 }
Esempio 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));
     }
 }
Esempio 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);
         //这里报错率很高,但不知道为什么
     }
 }
Esempio n. 5
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, RectangleF layoutRectangle, StringFormat format)
 {
     this.graphics.DrawString(s, font, brush, layoutRectangle, format);
 }
Esempio n. 6
0
 public SizeF MeasureString(string text, DUIFont font, float width, float height)
 {
     return(this.graphics.MeasureString(text, font, new SizeF(width, height)));
 }
Esempio 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);
 }
Esempio n. 8
0
 public void DrawString(string s, DUIFont font, DUIBrush brush, PointF p)
 {
     DrawString(s, font, brush, p.X, p.Y);
 }
Esempio n. 9
0
 public SizeF MeasureString(string text, DUIFont font, SizeF size)
 {
     return(this.MeasureString(text, font, size.Width, size.Height));
 }
Esempio n. 10
0
 public SizeF MeasureString(string text, DUIFont font)
 {
     return(this.MeasureString(text, font, float.MaxValue, 0));
 }
Esempio n. 11
0
 public static SharpDX.DirectWrite.TextLayout ToTextLayout(DUIFont font, string text)
 {
     return(new SharpDX.DirectWrite.TextLayout(directWriteFactory, text, font, float.MaxValue, 0));
 }