ArcObjects Library Reference (Carto)  

IImageServerLayer Interface

Provides access to 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
Read-only property AreaOfInterest The default area of interest for the layer.
Read/write property Cached Indicates if the layer needs its own display cache.
Read/write property Compression The transmission compression.
Read/write property CompressionQuality The transmission compression quality.
Read-only property DataFrameExtent The extent of the dataframe that contains the layer.
Read-only property DataSource Layers data source object.
Method Draw Draws the layer to the specified display for the given draw phase.
Method Initialize Initializes the layer with an image service URL.
Read/write property MaximumScale Maximum scale (representative fraction) at which the layer will display.
Read/write property MinimumScale Minimum scale (representative fraction) at which the layer will display.
Read/write property Name Layer name.
Read-only property Raster The assoicated raster.
Read/write property Renderer The assoicated raster renderer.
Read-only property ServiceInfo The image service info.
Read-only property ServiceURL The layers service URL.
Read/write property ShowResolution Indicates if the image resolution should be displayed in TOC.
Read/write property ShowTips Indicates if the layer shows map tips.
Write-only property SpatialReference Spatial reference for the layer.
Read-only property SupportedDrawPhases Supported draw phases.
Read-only property TipText Map tip text at the specified location.
Read-only property Valid Indicates if the layer is currently valid.
Read/write property Visible Indicates if the layer is currently visible.
Read/write property VisibleExtent The Visible extent of the layer in the data frame.

Inherited Interfaces

Interfaces Description
ILayer Provides access to members that work with all layers.

CoClasses that implement IImageServerLayer

CoClasses and Classes Description
ImageServerLayer Image server layer source and display options.

Remarks

IImageServerLayer interface allows you to access properties of an ImageServerLayer created from an ImageServer. The properties include compression type and quality, serviceinfo, service URL, and so on. An ImageServerLayer is similar to a RasterLayer; you can change how the pixels render on the display by changing the renderer applied to the layer.

ImageServerLayer needs to be initialized using the Initialize method before use.

[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