# LoadImage

## Description

Loads an image from a file, can also be used to load an atlas texture that will be used by sub images.
If loading an atlas texture a subimages.txt file must exist detailing all the images contained on it.
Most mobile platforms only support images that are a power of 2 in width and height (8,16,32,64,128 pixels, etc). If you load an image that is not a power of 2 size on a platform that does not support it your image will be increased in size until it matches the next power of 2 size. This does not affect the quality of the image as the extra pixels will be blank and used as padding only, but will increase the amount of memory used to store the image.
If you have lots of non-power of 2 images you could combine them into an atlas texture that is a power of 2 to make best use of memory.
Please note that RGB formats must be used for colour compatibility with all platforms. If you use any other encoding system, the colours will look wrong on different devices such as iPad.

## Definition

LoadImage( ID, sImageFilename )

void agk::LoadImage( UINT ID, const char* sImageFilename )

LoadImage( iImageIndex, sImageFilename, bBlackToAlpha )

void agk::LoadImage( unsigned int iImageIndex, const char *sImageFilename, int bBlackToAlpha )

integer LoadImage( sImageFilename, bBlackToAlpha )

UINT agk::LoadImage( const char* sImageFilename, int bBlackToAlpha )

integer LoadImage( sImageFilename )

UINT agk::LoadImage( const char* sImageFilename )

## Parameters

- ID - ID number for the image
- sImageFilename - The filename of the image to load
- iImageIndex - The ID to use to reference this image later.
- bBlackToAlpha - Set to 1 to override the image's alpha channel to be transparent where there are black pixels and opaque otherwise (default 0)