public void ReRender(OnRenderIsFinishedHandler finishNotify, Image img) { _renderFinishedNotify = finishNotify; using (Graphics g = Graphics.FromImage(img)) { if (_mapRuntime == null || _mapRuntime.Map == null) { g.Clear(Color.White); return; } try { _renderArg.BeginRender(g); _renderArg.IsReRender = true; g.Clear(_mapRuntime.Map.MapArguments.BackColor); _mapRuntime.Render(_renderArg); } finally { _renderArg.EndRender(); //触发渲染完毕的事件通知(异步方式通知) if (_renderFinishedNotify != null) { //_container.BeginInvoke(_renderFinishedNotify); //BeginInvoke(_renderFinishedNotify); _renderFinishedNotify = null; } } } }
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; } } }
private void DirectRender(RenderArgs args) { if (_mapRuntime.Map.LayerContainer.Layers != null) { //旋转所有标注 int angle = _canvas.IsReverseDirection ? 180 : 0; foreach (CodeCell.AgileMap.Core.ILayer lyr in _mapRuntime.Map.LayerContainer.Layers) { if (lyr is CodeCell.AgileMap.Core.IFeatureLayer) { (lyr as CodeCell.AgileMap.Core.IFeatureLayer).LabelDef.Angle = angle; } } } _mapRuntime.Render(args); }