ESRI banner

IImageService.GetImage method

Applies To: IImageService

Extracts an image to a file based on the extents and the dimensions set using the SetImageInfo method.

[Visual Basic 6.0]

variable = Object.GetImage(requestString)

Arguments

[in] requestString

String. For more details view the XML schema available at:

[ArcGIS Image Server installation folder]\Developer Kit\XML\ISClient.GetImage.XSD

Return Value

String. For more details view the XML schema available at:

[ArcGIS Image Server installation folder]\Developer Kit\XML\ISClient.GetImage.XSD

Remarks

This method should be called only if the image information is set successfully using the SetImageInfo method.

Requirements

Platform

32 bit Windows OS (WinXP)

Environment

.NET Framework, COM, ANSI C / C++ Standard compliant

Dependency

ESRI.ImageServer.ISClient.dll (.NET Framework), ISClient.dll (COM/C++), ISClientC.dll (C/C++)

Include

isclientc.h (ANSI C)

Example

[Visual Basic 6.0]

Private Sub Form1_Load()

Dim client As New CClientObject

Dim strConfigPath as String

strConfigPath = "c:\Program Files\Common Files\ESRI\Image Server\XADefs\ISViewer.ISCConfig"

If client.Init(strConfigPath) = False Then

MsgBox client.Status

Exit Sub

End If

 

'Open the image service

Dim cService As CImageService

Set cService = client.OpenImageService("ImageService://hawkings:10000/Dxb_Tif", "")

 

'Set the extents and the dimensions of the requested image

Dim returnVal As Boolean

returnVal = cService.SetImageInfo(120034.5, 869002.6, 120500.13, 869711.39, 500, 500)

If returnVal = False Then

MsgBox cService.Status

Exit Sub

End If

 

Dim imageInfoXml as String

imageInfoXml = "<ImageServer><Client><GetImage><OutputType></OutputType><FileName></FileName><Format></Format></GetImage></Client></ImageServer>"

 

'Load the XML string in DOM Document object and modify the values of each node.

Dim imageInfoDoc As New DOMDocument 

If imageInfoDoc.loadXML (imageInfoXml) = False Then

MsgBox "Failed to load the XML"

Exit Sub

End If

imageInfoDoc.selectSingleNode("//ImageServer/Client/GetImage/OutputType").Text = "File"

imageInfoDoc.selectSingleNode("//ImageServer/Client/GetImage/FileName").Text = "C:\Temp\OutImage.tif"

imageInfoDoc.selectSingleNode("//ImageServer/Client/GetImage/Format").Text = "TIFF"

imageInfoXml = imageInfoDoc.Text

 

'Create the image file to the output location

dim isGetImageDone as String

isGetImageDone = cService.GetImage(imageInfoXml)

 

'Close the service and disconnect the connection to ImageServer

cService.Close

client.Close

 

End Sub

For a detailed example, please see the ISViewer Sample in VB 6.0 in [ArcGIS Image Server installation folder]\Developer Kit\Client Applications\Samples\ folder.

Related Topics

See also: SetImageInfo, GetImageByExtent