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


PixelBlock CoClass (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (DataSourcesRaster)  

PixelBlock CoClass

Esri PixelBlock, a container of pixel data.

Product Availability

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

Description

The PixelBlock object contains a pixel array that can be read from a raster or a raster band. The PixelBlock object is designed to handle generic pixel arrays from any raster data source. This means it must be able to handle single and multiband data, as well as support different pixel types. To support different pixel types, the PixelBlock transports pixels in a SafeArray, which has the ability to contain many different data types. To support multiple bands, or planes, of raster data, the PixelBlock provides a separate array for each band in the raster.

You can get the pixel data from the pixel block, modify the pixel values, and write the pixel block with the modified pixel values to a raster band. If the pixel block is created from a Raster, the modified pixel block can be written to raster dataset using IRasterEdit::Write.

The PixelBlock object can be created from both Raster and RasterBand. In addition, a RasterCursor can also create the PixelBlock object. A PixelBlock that is created for use with one object may not be usable with another object because of the way the PixelBlock is initialized.

The PixelBlock can be created in any size, but after it is created, its size cannot be changed. For small rasters, the PixelBlock can be the size of the entire dataset, which can usually be held in memory at one time.
Larger rasters can be read in as smaller pieces by creating a smaller PixelBlock and reading portions of the raster sequentially.

Supported Platforms

Windows, Solaris, Linux

Interfaces

Interfaces Description
IPixelBlock (esriGeoDatabase) Provides access to members that control a PixelBlock.
IPixelBlock2 Provides access to members that control a PixelBlock.
IPixelBlock3 Provides access to members that control a PixelBlock.
IPixelBlock4 Provides access to members that control a PixelBlock.