8.5. tsImageNew

Syntax

Pascal

procedure tsImageNew(ImageID: tsImageID; Width: tsInt; Height: tsInt;
  Format: tsEnum);

C/C++

void tsImageNew(tsImageID ImageID, tsInt Width, tsInt Height,
  tsEnum Format);

Description

This function allocates new image data for an image object. Previous existing data will be freed an completelly lost. The data will be initialized with zero.

Params

ImageID

The ImageID on with the new data will be allocated

Width

Width of the resulting image data.

Height

Height of the resulting image data.

Format

The format of the image data. For an complete list of formats see tsSetParameter.

Error Codes

TS_NO_ACTIVE_CONTEXT

If there was no context bound.

TS_OUT_OF_MEMORY

If you tries to copy an image that is to large.

TS_INVALID_ENUM

This occours if you pass an unknown Format to this function.

TS_INVALID_VALUE

This will happen if you pass an invalid ImageID to this function. It also will happen if you pass zero (or less) for the width or the height.

TS_ERROR

There was an unknown error. Please inform me in which case this happens.