
[Example]
The following program displays a cursor.
#include <graph.h>
#include <malloc.h>
void example( short rsx, short rsy, short ch_num, short OldColor,
short ForColor, short BakColor )
{
char *image ;
long image_size ;
short w, h ;
w = ch_num*8 ;
h = 16 ;
image_size = ( w+15 ) / 16 * 2 * h + 4 ;
if ( image_size > 4096L ) return ;
image = malloc( (short)image_size ) ;
if ( image == NULL ) return ;
_getpattern( rsx, rsy, rsx+w-1, rsy+h-1, image, OldColor ) ;
_putpattern( rsx, rsy, image, _GPSET, ForColor, BakColor ) ;
free( image ) ;
return ;
}