8.13. tsImageResize

Syntax

Pascal

procedure tsImageResize(ImageID: tsImageID; Width: tsInt;
  Height: tsInt; X: tsInt; Y: tsInt);

C/C++

void tsImageResize(tsImageID ImageID, tsInt Width,
  tsInt Height, tsInt X, tsInt Y);

Description

With this function you can expand or shrink an image. It's not an resampling of an image! You can pass an new size and the position of the image to it. If the size is smaller than the original size the overlapping data will be lost. If the size is larger the new range will be initialized zero.

[Note] Note

If you pass zero for the width or the height the image data will be freed. After this the image is empty.

Params

ImageID

The ID of the image which will be resized.

Width

The new width of the image.

Height

The new height of the image.

X

The horizontal position where the original image will be placed.

Y

The vertical position where the original image will be placed.

Error Codes

TS_NO_ACTIVE_CONTEXT

If there was no context bound.

TS_INVALID_OPERATION

If you try to resize an empty image.

TS_INVALID_VALUE

This will happen if you pass an invalid ImageID to this function.