Partialrefresh () reprinted

Source: Internet
Author: User

Object. PartialRefresh (phase, Data, envelope) --- good experiences Favorites

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 fuzzy obscure 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.

A Cache is a screen-Independent Bitmap that represents an application window.

ScreenDisplay can be used to create any number of caches.

The image is not directly painted on the screen, but first painted in caches, and then painted on the screen by caches.

When the application window blur needs to be re-painted, it is directly performed from caches rather than from the database.

In this way, caches improves the efficiency --------- bitmap rendering is much faster than reading explicit data from the database.

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 setsILayer: CachedEqual to TRUE. In this case, the Map will create a separate cache for the layer and groups the layers abve and below it into different caches.

Generally, a map creates three caches: one for all layers, the other for annotation or graphics, and the third for selection.

If a Layer sets its cached attribute to TRUE, this Layer can be used to create its own private cache. in this way, the map creates a separate cache for this layer, and the map places other layers in different caches before or after it.

IActiveView: PartialRefreshUses 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.

UseIActiveView: RefreshVery low efficiency, which will make all caches invalid for re-painting.

Use IActiveView: PartialRefresh whenever possible

Both PartialRefresh and Refresh callIScreenDisplay: InvalidateWhich 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 and Refresh callIScreenDisplay: InvalidateIf it is set to true, the client draws a cache from the database. If it is set to false, it draws a cache from the cache.

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

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.

You can use OR to combine parameters.

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.

Using parameters will only make some data invalid for re-painting. For example, if a layer is loaded and Its cached attribute is set to TRUE, this layer can be independently replaced by invalidated, A tracking layer is an excellent example.

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.

The envelope parameter specifies a redraw area. For example, if an element is added, you only need to redraw the area around the element.

Both the data and envelope parameters are optional.

* When selecting features, you must callPartialRefreshTwice, once before and once after the selection operation.

When selecting an element, you must use PartialRefresh twice, one before the Select Operation, and one after the Select Operation.

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

 pActiveView.PartialRefresh esriViewGeography + esriViewGeoSelection, Nothing, Nothing 

Which is the same:

 pActiveView.PartialRefresh 6, Nothing, Nothing

Below are several usage examples in Visual Basic.

Map:

Refresh layer          pActiveView.PartialRefresh esriViewGeography, pLayer, Nothing 
Refresh all layers     pActiveView.PartialRefresh esriViewGeography, Nothing, Nothing 
Refresh selection      pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
Refresh labels         pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing

PageLayout:

Refresh element        pActiveView.PartialRefresh esriViewGraphics, pElement, Nothing
Refresh all elements   pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
Refresh selection      pActiveView.PartialRefresh esriViewGraphicSelection, Nothing, Nothing

The example shows how to select and refresh graphics and features usingPartialRefresh.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.