This document is archived and information here might be outdated.  Recommended version.


IImageServerLayer2 Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Carto)  

IImageServerLayer2 Interface

Provides access to additional members that control an image server layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

This interface is new at ArcGIS 9.3.

Members

Description
Method GetImageMetadata The image metadata xml.
Method GetMetaData The image service metadata xml.
Method GetProperty Gets the value of the given property.
Read-only property IsDataSourceAIS Indicates if the backend data source is AIS.
Read/write property MosaicProperties The image service mosaic properties xml.
Read-only property ServiceInfo The image service info xml.
Read-only property ServiceProperties The image service properties xml.
Read/write property ViewpointProperties The image service viewpoint properties xml.

CoClasses that implement IImageServerLayer2

CoClasses and Classes Description
ImageServerLayer Image server layer source and display options.
[C#]

This example shows how to create an image server layer from a URL, clip a portion of image and save it to a file.

public static void AccessImageServerLayer()
{
  //create an image server layer by passing an URL
  IImageServerLayer2 imageserverlayer=new ImageServerLayerClass();
  string URL="http://myserver/arcgis/services/amazon/imageserver";
  imageserverlayer.Initialize(URL);

  //get raster from the image server layer
  IRaster raster=imageserverlayer.Raster;

  //raster from image server is normally large, you need to
  //define the size of the raster
  IRasterProps rasterProps=(IRasterProps)raster;
  IEnvelope clipEnvelope=new EnvelopeClass();
  clipEnvelope.PutCoords(779000, 9628000, 786000, 9634000);
  rasterProps.Extent=clipEnvelope;
  rasterProps.Width=256;
  rasterProps.Height=256;

  //save the clipped raster to File Geodatabase
  ISaveAs saveas=(ISaveAs)raster;
  IWorkspaceFactory workspaceFact=new FileGDBWorkspaceFactoryClass();
  IWorkspace workspace=workspaceFact.OpenFromFile("c:\temp\fgdb.gdb",0);
  saveas.SaveAs("clipfromimageserverlayer", workspace, "gdb");
}

[Visual Basic .NET]

This example shows how to create an image server layer from a URL, clip a portion of image and save it to a file.

Public Shared Sub AccessImageServerLayer()
  'create an image server layer by passing an URL
  Dim imageserverlayer As IImageServerLayer2=New ImageServerLayerClass()
  Dim URL As String="http://myserver/arcgis/services/amazon/imageserver"
  imageserverlayer.Initialize(URL)

  'get raster from the image server layer
  Dim raster As IRaster=imageserverlayer.Raster

  'raster from image server is normally large, you need to
  'define the size of the raster
  Dim rasterProps As IRasterProps=CType(raster, IRasterProps)
  Dim clipEnvelope As IEnvelope=New EnvelopeClass()
  clipEnvelope.PutCoords(779000, 9628000, 786000, 9634000)
  rasterProps.Extent=clipEnvelope
  rasterProps.Width=256
  rasterProps.Height=256

  'save the clipped raster to File Geodatabase
  Dim saveas As ISaveAs=CType(raster, ISaveAs)
  Dim workspaceFact As IWorkspaceFactory=New FileGDBWorkspaceFactoryClass()
  Dim workspace As IWorkspace=workspaceFact.OpenFromFile("c:" & Constants.vbTab & "emp" & Constants.vbFormFeed & "gdb.gdb",0)
  saveas.SaveAs("clipfromimageserverlayer", workspace, "gdb")
End Sub