# LoadImageResized

## Description

Loads an image, resizing it in the process. This allows you to have one high quality image and then resize it based on the device resolution at runtime, instead of having multiple levels of quality. Reducing the image size is preferred to increasing the image size as increasing the image size doesn't improve the quality, but both are supported. A value of 1.0 does not change the image size, a value less than 1 will make the image smaller, a value greater than 1 will make the image bigger. Scaling values must be greater than 0, but can be any fraction, i.e. a scale of 0.6742 would be valid. A scale of 0.5 would halve the image size, 2.0 would double to image size, and so on. The image can be resized differently in the X and Y directions, although this will cause stretching. If you load an atlas texture using this command then the subimages.txt file will also have its values resized so that LoadSubImage will still work correctly. The cache parameter is no longer used as the image scaling is now done by the GPU so has almost no impact on performance

## Definition

integer LoadImageResized( szFilename, scaleX, scaleY, cache )

UINT agk::LoadImageResized( const char* szFilename, float scaleX, float scaleY, int cache )

LoadImageResized( iImageID, szFilename, scaleX, scaleY, cache )

void agk::LoadImageResized( UINT iImageID, const char* szFilename, float scaleX, float scaleY, int cache )

## Parameters

- szFilename - The name of the file to load
- scaleX - The amount to scale in the X direction, 1.0 is the original size
- scaleY - The amount to scale in the Y direction, 1.0 is the original size
- cache - No longer used, must be 0
- iImageID - The ID to use to reference this image in future