home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Panoráma
/
computer_panorama_1997-12-hibas.iso
/
SHARE
/
GRAPH
/
PTC051.ZIP
/
EXAMPLES
/
IMAGE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-23
|
990b
|
55 lines
//////////////////
// image viewer //
//////////////////
#include "ptc.h"
#include <iostream.h>
int main(int argc,char *argv[])
{
// initialize from command line
PTC ptc(320,200,argc,argv);
if (!ptc.ok())
{
if (!ptc.Init(320,200))
{
// failure
ptc.Close();
cout << "could not initialize ptc\n";
return 1;
}
}
// get display resolution
int xres=ptc.GetXResolution();
int yres=ptc.GetYResolution();
// load image
Surface surface(ptc,"image.tga");
if (!surface.ok())
{
ptc.Close();
cout << "could not load image\n";
return 1;
}
// convert image
if (!surface.Convert(ARGB8888))
{
// failure
ptc.Close();
cout << "could not convert image\n";
return 1;
}
// display image
surface.Update();
ptc.getch();
return 0;
}