ESRI banner

IImageService.ImageBuffer property

Applies To: IImageService

Image buffer is an array of bytes used for saving the requested image.

[Visual Basic 6.0]

object.ImageBuffer = [ value ]

Access

Read / Write

Type

Integer

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

 

  ‘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.

 

End Sub

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

Related Topics

See also: GetImageByExtent