Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_Image Class Reference

Inheritance diagram for PG_Image:

Inheritance graph
[legend]
Collaboration diagram for PG_Image:

Collaboration graph
[legend]
List of all members.

Detailed Description

A static (non-resizeable) frame with image.

Author:
Jaroslav Vozab


Public Member Functions

 PG_Image (PG_Widget *parent, const PG_Point &p, const char *filename, const char *style="ThemeWidget")
 Contructor of the PG_Image class (loading from file).

 PG_Image (PG_Widget *parent, const PG_Point &p, SDL_Surface *image, bool freeimage=true, const char *style="ThemeWidget")
 Contructor of the PG_Image class (image from surface).

 PG_Image (PG_Widget *parent, const PG_Point &p, const char *filename, Uint32 colorkey, const char *style)
 Contructor of the PG_Image class (loading from file).

void SetColorKey (Uint32 key)
 Set the colorkey of the image.


Protected Member Functions

void eventDraw (SDL_Surface *surface, const PG_Rect &rect)
 overridable eventhandler to draw the object surface

void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen


Constructor & Destructor Documentation

PG_Image::PG_Image PG_Widget parent,
const PG_Point p,
const char *  filename,
const char *  style = "ThemeWidget"
 

Contructor of the PG_Image class (loading from file).

Parameters:
parent pointer to the parent widget or NULL
p position of the PG_Image widget
filename image-file to load
style widgetstyle to use This constructor creates the widget and loads the image from a file

PG_Image::PG_Image PG_Widget parent,
const PG_Point p,
SDL_Surface *  image,
bool  freeimage = true,
const char *  style = "ThemeWidget"
 

Contructor of the PG_Image class (image from surface).

Parameters:
parent pointer to the parent widget or NULL
p position of the PG_Image widget
image pointer to imagedata (SDL_Surface)
freeimage if true the imagedata is handled by the widget
style widgetstyle to use

PG_Image::PG_Image PG_Widget parent,
const PG_Point p,
const char *  filename,
Uint32  colorkey,
const char *  style
 

Contructor of the PG_Image class (loading from file).

Parameters:
parent pointer to the parent widget or NULL
p position of the PG_Image widget
filename image-file to load
colorkey colorkey (0xRRGGBB)
style widgetstyle to use This constructor creates the widget and loads the image from a file using a colorkey.


Member Function Documentation

void PG_Image::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_ThemeWidget.

void PG_Image::eventDraw SDL_Surface *  surface,
const PG_Rect rect
[protected, virtual]
 

overridable eventhandler to draw the object surface

Parameters:
surface the widgets drawing surface.
rect rectangle to draw within. This eventhandler is called whenevener the widget contents should be redrawn.
Note:
Only widgets with drawing surfaces (see the constructor) will call this eventhandler.

Reimplemented from PG_ThemeWidget.

void PG_Image::SetColorKey Uint32  key  ) 
 

Set the colorkey of the image.

Parameters:
key colorkey (0xRRGGBB);


The ParaGUI Project - Alexander Pipelka