PartialRefresh方法是部分刷新,效率方面比单纯的Refresh方法高很多。调用Refresh总是绘画毎一个对象。这是非常低效的。所以应该多使用PartialRefresh方法而少用Refresh。
刷新图层:
pMap.PartialRefresh(esriViewGeography, pLayer, null);
刷新所有图层:
pMap.PartialRefresh(esriViewGeography, null, null);
刷新所选择的对象:
pMap.PartialRefresh(esriViewGeoSelection, null, null);
刷新标注:
pMap.PartialRefresh(esriViewGraphics, null, null);
刷新图元
pLayout.PartialRefresh(esriViewGraphics, pElement, null);
刷新所有图元
pLayout.PartialRefresh(esriViewGraphics, null, null);
刷新所选择的图元
pLayout.PartialRefresh(esriViewGraphicSelection, null, null);
特殊的对于清除选择集,要在清除前后均进行一次刷新
void ClearSelectedMapFeatures(ESRI.ArcGIS.Carto.IActiveView activeView, ESRI.ArcGIS.Carto.IFeatureLayer featureLayer)
2: {
null)
4: {
return;
6: }
// Dynamic Cast
// Invalidate only the selection cache. Flag the original selection
null);
// Clear the selection
11: featureSelection.Clear();
// Flag the new selection
null);
14: }