#include <ZE_ZImage.h>
Inherits ZE::ZObject.
Public Methods | |
| ZImage () | |
| Default Constructor. | |
| ZImage (string filename) | |
| Constructor to Construct from File. | |
| ZImage (SDL_Surface *surface) | |
| Constructor to Construct from SDL_Surface*. | |
| ZImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) | |
| Constructor to Construct from part of an SDL_Surface*. | |
| ~ZImage () | |
| Destructor, frees memory. | |
| void | Open (string filename) |
| Opens a file. | |
| void | OpenFromImage (SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h) |
| Cuts part of an existing image to create the new image. | |
| void | Attach (SDL_Surface *surface) |
| Attach an existing surface to class. | |
| void | Release () |
| Releases image. | |
| void | SetAlpha (Uint8 alpha) |
| Sets Alpha (transparency) value of Image. | |
| void | SetColorKey (Uint32 color) |
| Set Color Key (transparent color) of Image. | |
| void | Draw (Sint16 x, Sint16 y) |
| Draw Image to Screen. | |
| bool | IsLoaded () |
| Check if file is loaded. | |
| SDL_Surface * | GetImage () |
| Get SDL_Surface. Get SDL_Surface pointer to actual image data. | |
| int | GetWidth () |
| Get Width. | |
| int | GetHeight () |
| Get Height. | |
| string | GetFilename () |
| Get filename of image. | |
Protected Attributes | |
| ImageData | rImage |
| Class containing image and filename. | |
|
|
Default Constructor, does nothing. |
|
|
Constructor is same as calling ZImage::Open() on passed filename.
|
|
|
Constructor is same as calling ZImage::Attach() on passed SDL_Surface*.
|
|
||||||||||||||||||||||||
|
Constructor is same as calling ZImage::OpenFromImage.
|
|
|
Destructor calls ZImage::Release(). |
|
|
Open a file using ZEngine. Loads into rImage member of class.
|
|
||||||||||||||||||||||||
|
Cut part of an SDL_Surface to create a new Image.
|
|
|
Attach a pointer to instance of ZImage. (NOTE: Should not be used on a surface that is owned elsewhere.)
|
|
|
Frees memory via call to SDL_FreeSurface for the image. |
|
|
Set Alpha channel of an Image, only used in 32 bit mode.
|
|
|
Set color which will not be drawn in image.
|
|
||||||||||||
|
Draw Image to screen at specified location.
|
|
|
Check if file is loaded and pointer to data is non-NULL.
|
|
|
|
|
|
Get Width of Image.
|
|
|
Get Height of Image.
|
|
|
Get filename of image or if Image doesn't have a specific filename string describing origin of image.
|
1.3-rc1