IImageService.GetImageByExtent method
Applies To: IImageService
Extracts the image in memory based on the image dimensions that are set in advance using the SetImageInfo method.
[Visual Basic 6.0]
variable = Object.GetImageByExtent()
Return Value
Boolean that determines the image request state
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\ArcGIS\ImageServer10.0\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
'To write the virtual image a buffer of bytes needs to be created and maintained.
Dim pBuffer() As Byte
pBufferSize = cService.GetRecommendedBufferSize
'The buffer needs to be initialized to the recommended buffer size.
ReDim pBuffer(pBufferSize)
'A pointer to the buffer needs to be passed to the Image Service. .
Dim pBufferAddress As Long
pBufferAddress = VarPtr(pBuffer(0))
cService.ImageBuffer = pBufferAddress
'Create the image and save it in the buffer.
Dim isImageCreated As Boolean
isImageCreated = cService.GetImageByExtent
'This buffer should now be drawn directly onto the display using the tools provided by the host
'application.
'Close the image service and disconnect from ArcGIS Image Server
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: OpenImageService , SetImageInfo, GetRecommendedBufferSize, ImageBuffer, GetImage