Loads an image from a file. Can also be used to load an atlas texture that will be used by sub images.
constructor Create(const Owner: TAgkObject; const Filename: String; const BlackToAlpha: Boolean = False; const GenerateMipmaps: Boolean = False); overload;
Parameters |
Description |
const Owner: TAgkObject |
the owner of the new image (eg. a TAgkScene object). |
const Filename: String |
the filename of the image to load. If the file does not exists or is invalid, a default image will be used (a red cross on a checkered background). |
const BlackToAlpha: Boolean = False |
(optional) Set to True to override the image's alpha channel to be transparent where there are black pixels and opaque otherwise (default False). |
const GenerateMipmaps: Boolean = False |
(optional) Set to True to automatically generate mipmaps for this image (default False). |
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.
Copyright (c) 2012. All rights reserved.
|