private void Render(PaintEventArgs e) { if (_vectorMapRuntime == null || _vectorMapRuntime.Map == null) { e.Graphics.Clear(BackColor); return; } try { _renderArg.BeginRender(e.Graphics); e.Graphics.Clear(_vectorMapRuntime.Map.MapArguments.BackColor); _vectorMapRuntime.Render(_renderArg); // if (_currentMapTool != null) { _currentMapTool.Render(_renderArg); } } finally { _renderArg.EndRender(); //触发渲染完毕的事件通知(异步方式通知) if (_renderFinishedNotify != null) { this.DoBeginInvoke(_renderFinishedNotify); _renderFinishedNotify = null; } } }
public void Render(object sender, IDrawArgs drawArgs) { if (_mapRuntime == null) { return; } if (_canvas == null) { _canvas = sender as ICanvas; Init(); } else { if (_coordinateTranform == null) { _coordinateTranform = _canvas.CoordTransform; } } _renderArgs.BeginRender(drawArgs.Graphics as Graphics); try { if (_isEnableDummyRender) { DoRender(_renderArgs); } else { DirectRender(_renderArgs); } } finally { _renderArgs.EndRender(); } }