Generic Tools/Controls required by a client application

A typical client application should have the facilities to add, remove, and request for images from ArcGIS Image Server. In addition, it should be able to change the properties of the image service, save references to the loaded services, and reconnect to the server automatically.

Add image service

There should be a command to add an image service to the client application. This can be done as a custom tool, menu, or a hot key. If the application can handle the addition of extra file types, consider adding the Image Service Reference (.ISRef) file as a known image format that adds an image services reference within an .ISRef file. (ISRef files can be created using the Image Server Viewer).

On selecting Add image services

1. Pass to ISClient to make a connection to the server. If there is an error, report the error.
2. Check if the image service is already loaded. If so, give the warning “Service is already loaded. Load again?”.
3. Create a dummy image object and attach attributes.
4. If there is a legend available for the client application, set the name of the object to the name retrieved from the image service. If possible, the user should be allowed to change this name but internally the name or link to the image service should be maintained.
5. If no other objects are loaded, then zoom to extents of the image service or refresh the display.

Remove an Image Service

Removing an image service from an application requires more than just deleting the temporary image and removing the layer object. The connection to the image server has to be closed. Removing an image service can be handled in two ways:

1.Using the inbuilt remove function

This function should be used if there is an event triggered to notify the client application that the object has been removed from the display. If this case applies, the removed object should be identified and the relevant connection to image server should be closed and the object destroyed.

2.Adding a custom remove function

If the client application does not facilitate the removal of objects from the display or if there is no event triggered after removal, then a custom tool to remove image services is required. This tool will handle removing the object, closing the connection, and destroying the object from memory.


Displaying the properties of the image service can be handled in two ways. The ISClient DLL provides the developer with its own dialog box. The developer can also access the individual pages of the Properties dialog, and this can be embedded in the host application dialog boxes if permissible.

1. Using the ISClient DLL properties dialog-
a. Get the selected image service object from the application's legend or from the list of loaded services.
b. Get the name stored in the attributes of the image service object.
c. Using this name, pass it to the ISClient DLL and request for the Properties dialog box.
d. Display the dialog box.
e. If user clicks OK, get the updated properties.
f. Refresh the image service object.
g. Otherwise do nothing.
2. Using the ISClient DLL properties dialog pages-

This method is to be used only if the properties pages can be embedded into the client applications Properties dialog. The idea is to integrate the image server client application as closely as possible with the host application.

a. Get the selected image service object from the applications legend or from the list of loaded services.
b. Get the name stored in the attributes of the image service object.
c. Using this name pass it to the ISClient DLL and request for the Properties page(s) related to the image service object.
d. Add this page to the host application Properties dialog box.
e. Display the dialog box.
f. If OK get the updated properties by using the service dialog object.
g. Set the updated properties to the Image Service object.
h. Using the Image Service object apply the updated properties.

NOTE: If the host application has non-modal dialog boxes, then an Apply button could be added to the form.

On/Off and auto refresh image service connection state

An image service connection may require to be paused without removing or switching the visibility of the image service off. To facilitate this functionality a custom tool or state button can be added to the host application. In the case of a state button, the user can show the status of this image service by being pressed in as ON and normal as OFF. This function is not mandatory and can be ignored if not required. The connection state should be stored as an attribute of the image service object. The connection state is not a property of the image service object, therefore the control has to be made at the client application level by preventing further requests when the map displays are refreshed incase the state is set to OFF. Incase this functionality is put into the client application, the default state of a newly added image service should be set to On.

Zoom to image service extent

Most clients have the option to zoom the full extent of one of its layers. However, while adding an image service the user is mainly viewing part of the image service and the host application may not have access to the full extent of the image service. In this case, it maybe necessary to provide a tool to access the full extent of the service and zoom to it. To do so, one would need to get the image service information and read its extent details.

For the active image service

1. Get the name of the image service object.
2. Get the image service info from the image service object.
3. Set the extents to the map display.
4. Refresh the display.

NOTE: The image server will change the extents of the service depending on the projection selected to ensure that the service does not extend beyond the horizon of the selected projection.

Export Image Dialog

The ISClient DLL provides a built-in dialog box to export the image service to a file-based image, specifying the format, file name, and image dimensions. This can also be done without the aid of a dialog box for file-based client applications; however, this can also be added for non-file-based applications as a custom tool to save the image to a file. Providing individual dialog boxes makes programming easier for the developer. For more information, see IExportImageDialog.

Startup/shutdown client application

Starting an application only initializes itself on starting the host application. Initializing an application should involve reading the configuration file that sets up the client application according to the set parameters.

Shutting down an application requires that all objects be destroyed and purged before the host application can shut down. This also involves checking for open connections and closing them if any.

Saving references

Most host applications have the ability to save project files. The state of an image service is defined in the .ISRef file. The project files can have a reference to the image service object and save the .ISRef file. If this object cannot be stored within the project file then solution has to be made. One possible solution is to store a reference to .ISRef files within the host application. This connection should then be restored on startup.