Routines (alphabetical) > Routines: H > HDF Routines > HDF_GR_CREATE

# HDF_GR_CREATE

This function creates an HDF GR raster image. Once a raster image has been created, it is not possible to change its name, data type, dimension sizes or number of pixel components. However, it is possible to create a raster image and close the file before writing any data values to it. Later, the values can be added to or modified in the raster image, which then can be obtained using HDF_GR_SELECT.

Note: On creation, any interlace mode may be set. This mode will be used until the file is closed. If the resulting file is reopened, the interlace mode will revert to pixel-interlace (0). Data can still be read in any interlace mode using the INTERLACE keyword to HDF_GR_READIMAGE. This is a limitation of the current HDF library.

## Syntax

Result = HDF_GR_CREATE(gr_id, name, ncomp, data_type, interlace_mode, dim_sizes)

## Return Value

Returns a raster image identifier if successful or FAIL (-1) otherwise.

## Arguments

### gr_id

GR interface identifier returned by HDF_GR_START.

### name

Name of the raster image. The length of the name should not be longer than 256 characters.

### ncomp

Number of pixel components in the image. This parameter must have a value of at least 1.

### data_type

Type of the image data. This parameter can be any of the data types supported by the HDF library.

### interlace_mode

Interlace mode of the image data. Valid values are:

- 0 = Pixel interlace
- 1 = Line interlace
- 2 = Component interlace

### dim_sizes

Array of sizes for each dimension of the image. The dimensions must be specified and their values must be greater than 0.

## Keywords

None

## Version History

5.2 | Introduced