8654b733ea
Files correlati : ca1.exe Ricompilazione Demo : [ ] Commento : Evitato di uscire da programma di stampa anialitica dopo ogni stampa git-svn-id: svn://10.65.10.50/branches/R_10_00@22568 c028cbd2-c16b-5b4b-a496-9718f37d4682
105 lines
3.4 KiB
C++
Executable File
105 lines
3.4 KiB
C++
Executable File
#ifndef __IMAGE_H
|
|
#define __IMAGE_H
|
|
|
|
#ifndef XVT_INCL_XVT
|
|
#include <xvt.h>
|
|
#endif
|
|
|
|
#ifndef __STRINGS_H
|
|
#include <strings.h>
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// TImage
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// @doc EXTERNAL
|
|
|
|
// @class TImage | Classe per la gestione delle imagini a video
|
|
//
|
|
// @base public | TObject
|
|
class TImage : public TObject
|
|
|
|
// @author:(INTERNAL) Guido
|
|
{
|
|
// @access Private Member
|
|
|
|
// @cmember:(INTERNAL) Immagine de gestire
|
|
XVT_IMAGE _image;
|
|
// @cmember:(INTERNAL) Rettangolo originale (origine 0,0 e dimensioni originali) dell'immagine
|
|
RCT _src;
|
|
// @cmember:(INTERNAL) Rettangolo di visualizzazione dell'immagine (dove mettere l'immagine)
|
|
RCT _dst;
|
|
|
|
// @access Public Member
|
|
public:
|
|
// @cmember Permette di settare la posizione della figura
|
|
void set_pos(int x, int y);
|
|
|
|
// @cmember Disegna l'immagine nella poszione di default e nella dimensione
|
|
// di defalut
|
|
void draw(WINDOW w) const ;
|
|
// @cmember Disegna l'immagine con dimensione default in un punto dello schermo
|
|
void draw(WINDOW w, int x, int y) const;
|
|
// @cmember Disegna/modifica l'immagine sullo schermo
|
|
void draw(WINDOW w, const RCT& dst) const;
|
|
const RCT& draw(WINDOW win, const RCT& dst, char halign, char valign, char grow) const;
|
|
// @cmember Disegna l'immagine sulla finestra
|
|
void draw(WINDOW w, const RCT& dst, const RCT& src) const;
|
|
// @cmember Setta un pixel
|
|
void set_pixel(int x, int y, COLOR c);
|
|
// @cmember Legge un pixel
|
|
COLOR get_pixel(int x, int y) const;
|
|
|
|
// @cmember Setta l'immagine e le sue dimensioni
|
|
XVT_IMAGE set(XVT_IMAGE i);
|
|
// @cmember Legge l'immagine dal file
|
|
XVT_IMAGE load(const char* n);
|
|
// @cmember Legge l'immagine dal file di risorse
|
|
XVT_IMAGE load(int id);
|
|
// @cmember Legge l'immagine dal file di risorse
|
|
XVT_IMAGE load_icon(int id);
|
|
|
|
// @cmember Controlla che l'immagine sia un oggetto valido (diverso da NULL)
|
|
virtual bool ok() const
|
|
{ return _image != NULL; }
|
|
|
|
// @cmember Ritorna la larghezza dell'immagine
|
|
short width() const
|
|
{ return _src.right; }
|
|
// @cmember Ritorna l'altezza dell'immagine
|
|
short height() const
|
|
{ return _src.bottom; }
|
|
// @cmember Ritorna il rettangolo dell'immagine originale
|
|
const RCT& rect() const
|
|
{ return _src; }
|
|
|
|
// @cmember Setta i colori dell'immagine in modo da renderla trasparente
|
|
// usando l'angolo in alto a sinistra dell'imagine stessa
|
|
void convert_transparent_color(COLOR transparent);
|
|
|
|
// Trasforma l'immagine in toni di grigio.
|
|
// Se gray>=0 sfuma ulteriormente verso il tono specificato
|
|
void fade_to_gray(bool use_btn_colors);
|
|
|
|
// @cmember Setta l'<p n>.esime entry della paletta al colore <p c>
|
|
void set_clut(byte n, COLOR c);
|
|
|
|
XVT_IMAGE xvt_image() const { return _image; }
|
|
operator XVT_IMAGE() const { return xvt_image(); }
|
|
|
|
static bool build_filename(TFilename & file);
|
|
// @cmember Costruttore. Viene passato il nome del file
|
|
TImage(const char* n);
|
|
// @cmember Costruttore. Viene passato l'identificatore dell'immagine sul file di risorsa
|
|
TImage(int id, bool is_icon = false);
|
|
// @cmember Costruttore. Viene passata l'immagine e le sue dimensioni
|
|
TImage(const TImage& i, short width = -1, short height = -1);
|
|
// @cmember Costruttore. Viene passata l'immagine e le sue dimensioni
|
|
TImage(short width, short height, XVT_IMAGE_FORMAT fmt);
|
|
// @cmember Distruttore
|
|
virtual ~TImage();
|
|
};
|
|
|
|
#endif
|