ESRI.ArcGIS.ADF.IMS
Dpi Property
See Also 
ESRI.ArcGIS.ADF.IMS.Carto Namespace > ImageDescriptor Class : Dpi Property




The resolution of the image in dots per inch (Dpi).

Syntax

Visual Basic (Declaration) 
Public Property Dpi As Integer
Visual Basic (Usage)Copy Code
Dim instance As ImageDescriptor
Dim value As Integer
 
instance.Dpi = value
 
value = instance.Dpi
C# 
public int Dpi {get; set;}

Remarks

The Dpi setting is the number of pixels per inch in the display.

Using Dpi with map images

The Dpi setting can be used with an ImageDescriptor tied to a MapView to take scale dependencies of layers into consideration when drawing the map. If the map is drawn at the default setting, and the map is displayed at different sizes, the scale will change, and scale-dependent layers will not observe the same apparent thresholds. The Dpi can be used to maintain consistent behavior as scale changes.

Dpi overrides the default setting for the MapService (found in Dpi property of the Environment object). If the configuration file for the map service does not specify a DPI setting, the default of 96 will be assumed by the server.

Dpi is used for calculating the scale thresholds for map elements which have MinScale or MaxScale properties set. These include Layer (with derived types FeatureLayer, ImageLayer, and AcetateLayer), ScaleDependentRenderer, and AcetateElement (including derived types).

For more discussion of DPI, see ArcIMS Help, under the ArcXML Guide topics of "Using GET_IMAGE and IMAGE with Image Services" and "Using GET_LAYOUT and LAYOUT with ArcMap Image Services".

Using Dpi with layouts

The Dpi setting can be used with a LayoutView to specify the resolution of the output. This only applies when the ImageFormat of the layout is set to AI, EMF, EPS, PDF, and SVG. This allows a higher-resolution map to be produced within the layout.

Issues with screen DPI and map display

For screen displays, the Dpi should match the user's monitor or display. The default dpi for ArcIMS services is 96. Note that today's monitors, with higher pixel resolutions, often have effective dpi measurements considerably higher or lower than 96.

If the Dpi is not matched to the user's screen, then scale settings will not be correct. Scale-dependent layers will not turn on at the appropriate scale. A fractional scale (such as "1:100,000") or a verbal scale (such as "1 inch represents 10 miles") will not be exactly correct.

Ideally, the Dpi would be set for each user to match the individual user's display. But for Web applications, it is not possible to obtain a dpi measurement from the properties of the browser. To calculate the actual dpi, you must have the screen dimensions and number of pixels in the screen. A Web application can obtain pixel dimensions, but not the physical screen size. If the user were to input their own physical screen dimensions or actual Dpi, the Dpi could be calculated and set correctly.

Example

The user's screen display is 24 inches wide by 18 inches high, with a resolution of 1600x1200. The actual DPI is approximately 1600/24 = 67. However, the Dpi property setting in Environment is 96. A layer has a MaxScale of 1:10,000. The layer should not display unless the current scale is larger (more zoomed-in) than 1:10,000. A map is requested at a pixel size of 1000x800. The map extent is 10,000 feet by 8,000 feet. We can calculate the distance per pixel (dot) in this map:

(1000 pixels / 10,000 feet) * (1 / 12 in/ft) = 1 pixel / 120 inches

If the user's DPI is 67, the map will be displayed at a scale of:

(1 pixel / 120 inches) * (1 inch / 67 pixels) = 1/8040

or 1:8040. Therefore the scale-depended layer should be displayed in this map. However, if the Dpi setting is at 96, the server believes the map will be displayed at a scale of:

(1 pixel / 120 inches) * (1 inch / 96 pixels) = 1/11,520

or 1:11,520. The server will therefore not display the scale-dependent layer. The actual display of layers generally will not be observing scale settings correctly.

See Also

© 2010 All Rights Reserved.