何為ERP

The main application window is controlled by a view (IActiveView).  ArcMap currently has two view objects: Map (data view) and PageLayout (layout view).  Each view has a ScreenDisplay object which performs drawing operations. The ScreenDisplay object also makes it possible for clients to create any number of caches.  A cache is an off screen bitmap representing the application's window.  Instead of drawing directly to the screen, graphics are drawn into caches, then the caches are drawn on the screen.  When the application's window is obscured模糊 晦澀 and requires redrawing, it is done so from the caches instead of from a database.  In this way, caches improve drawing performance - bitmap rendering is faster than reading and displaying data from a database.

 一個Cache是一個獨立於屏幕的位圖,代表着應用程序窗口.

ScreenDisplay可以是客戶創建任意數量的Cache.

圖象並不是直接畫在屏幕上,而是先畫在caches中,然後由caches畫到屏幕上.

當應用程序窗口模糊需要重畫的時候,直接從caches中而不是從database中進行.

通過這種方式,caches提高了效率---------位圖渲染比從數據庫中讀顯數據快得多.

In general, the Map creates three caches: one for all the layers, another if there are annotation or graphics, and a third cache if there is a feature selection.  A layer can create its own private cache if it sets ILayer::Cached equal to TRUE.  In this case, the Map will create a separate cache for the layer and groups the layers above and below it into different caches.

一般而言,地圖建立三個caches:一個是爲所有圖層用的,另一個是在由annotation或graphics的時候用,第三個是爲selection準備的.

如果圖層把它的cached屬性設爲TRUE,這個圖層(Layer)可以用來建立自己的私有cache.這樣,地圖將爲這個圖層建立一個單獨的cache,地圖把其他圖層放在它之前或之後的不同caches中.

IActiveView::PartialRefresh uses its knowledge of the cache layout to invalidate as little as possible.  IActiveView::Refresh , on the other hand, invalidates all the caches which is very inefficient.  Use PartialRefresh whenever possible. 

使用IActiveView::Refresh效率極低,它會使所有的caches無效重畫.

儘可能使用IActiveView::PartialRefresh

Both PartialRefresh and Refresh call IScreenDisplay::Invalidate which sets a flag clients watch for.  Clients draw a cache from scratch (the database) if its flag is set to true, and from cache if the flag is set to false.

PartialRefresh和Refresh會調用IScreenDisplay::Invalidate ,如果設爲true,客戶端從數據庫畫一個cache,如果false,則從cache畫一個cache

The following table shows the phases each view supports and what they map to:

phase Map Layout
esriViewBackground   Map grids  Page/snap grid
esriViewGeography  Layers Unused
*esriViewGeoSelection  Feature selection Unused
esriViewGraphics   Labels/graphics Graphics
esriViewGraphicSelection  Graphic selection Element selection
esriViewForeground   Unused Snap guides

To specify multiple draw phases, combine individual phases together using a bitwise OR. This is equivalent to adding together the integer enumeration values. For example, pass 6 to invalidate both the esriViewGeography (2) and esriViewGeoSelection (4) phases.

可以通過OR組合使用參數.

Use the data parameter to invalidate just a specific piece of data.  For example, if a layer is loaded and its cache property is set to TRUE, this layer alone can be invalidated.  A tracking layer is a good example of this.

使用參數,只會使某些數據無效重畫,例如,如果一個圖層被加載進來並且其cached屬性設爲TRUE,這個圖層可以單獨被invalidated,A tracking layer就是一個極好的例子.

The envelope parameter specifies a region to invalidate.  For example, if a graphic element is added, it is usually only necessary to invalidate the immediate area surrounding the new graphic.

 envelope參數指定了一個重畫的區域.例如,如果一個元素被添加了,只需要重畫元素周圍的區域.

Both the data and envelope parameters are optional. 

*When selecting features, you must call PartialRefresh twice, once before and once after the selection operation.

選擇元素的時候,你必須使用PartialRefresh兩次,一次在選擇操作之前,一次在選擇操作之後.

In Visual Basic specify a phase of 6 to invalidate both the esriViewGeography (2) and the esriViewGeoSelection (4). 


which is the same as:


Below are several usage examples in Visual Basic.

Map:


PageLayout:



 

 The example shows how to select and refresh graphics and features using PartialRefresh.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章