Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#82 ilCopyImages.... ?

open
nobody
None
5
2005-03-23
2005-03-23
Anonymous
No

I am trying to copy a region of a loaded image to a new
image and it seems that I am ddoing something wrong ...
Can anyone see what is wrong here ? thnks

here is my code .. :

ILuint img ;
ILubyte *data;

ilGenImages( 1 , &img );
ilBindImage(img);

ilLoadImage("img/imagedata.bmp" );
data = ilGetData();

if ( data == NULL )
cout << " data is Null " << endl;
img = ilSetData(data) ;
img = ilCopyPixels ( 10 , 10 ,0 , 128 , 128 , 1 ,
IL_RGB ,IL_UNSIGNED_BYTE, data ) ;

ilEnable ( IL_FILE_OVERWRITE) ;
ilSave(IL_BMP , "img/img.bmp" ) ;

thnks
Franz Richter .

Discussion