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