public override void Draw(IDisplay display) { if (display == null || display.Canvas == null) { return; } SimpleTextSymbol sym = _symbol.Clone(new CloneOptions(display, false)) as SimpleTextSymbol; sym.Text = _text; sym.Angle = (float)this.Rotation; var size = display.Canvas.MeasureText(_text, sym.Font); double dx = size.Width * display.mapScale / (display.dpi / 0.0254); // [m] double dy = size.Height * display.mapScale / (display.dpi / 0.0254); // [m] base.Scale(dx, dy); IGeometry geometry = TransformGeometry(); if (geometry == null) { return; } display.Draw(sym, geometry); sym.Release(); }
public override void Draw(IDisplay display) { if (display == null || display.GraphicsContext == null) { return; } SimpleTextSymbol sym = _symbol.Clone(display) as SimpleTextSymbol; sym.Text = _text; sym.Angle = (float)this.Rotation; System.Drawing.SizeF size = display.GraphicsContext.MeasureString(_text, sym.Font); double dx = size.Width * display.mapScale / (display.dpi / 0.0254); // [m] double dy = size.Height * display.mapScale / (display.dpi / 0.0254); // [m] base.Scale(dx, dy); IGeometry geometry = TransformGeometry(); if (geometry == null) { return; } display.Draw(sym, geometry); sym.Release(); }