mojo:mojo.graphics.Image
The Image class.
An image is a rectangular array of pixels that can be drawn to a canvas using one of the Canvas.DrawImage methods.
Images are similar to pixmap's, except that they are optimized for rendering, and typically live in GPU memory.
To load an image from a file, use one of the Load, LoadBump or LoadLight functions.
To create an image from an existing pixmap, use the New( pixmap,... ) constructor.
To create an image that is a 'window' into an existing image, use the New( atlas,rect... ) constructor. This allows you to use images as 'atlases',
To create an 'empty' image, use the New( width,height ) constructor. You can then render to this image by creating a canvas with this image as its render target.
Images also have several properties that affect how they are rendered, including:
| Constructors | |
|---|---|
| New | Creates a new Image. |
| Properties | |
|---|---|
| BlendMode | The image blend mode. |
| Bounds | The image bounds. (read only) |
| Color | The image color. |
| Handle | The image handle. |
| Height | Image bounds height. (read only) |
| LightDepth | The image light depth. |
| Material | Image material. (read only) |
| Radius | Image bounds radius. (read only) |
| Rect | The image's texture rect. (read only) |
| Scale | The image scale. |
| Shader | Image shader. |
| ShadowCaster | Shadow caster attached to image. |
| Texture | The image's primary texture. |
| Width | Image bounds width. (read only) |
| Methods | |
|---|---|
| GetPixel | Gets a pixel color. |
| GetPixelARGB | Gets a pixel color. |
| Functions | |
|---|---|
| Load | Loads an image from file. |
| LoadBump | Loads a bump image from file(s). |
| LoadLight | Loads a light image from file. |