Loading an Icon Archive
I_LOADFILE!(POINTERS%[], BUFFER%[], cat%, name$)
The function loads the icon archive with the name name from category cat. The file mode is given by the global variable i_mode (3 (Memo) per default). The icons are stored to the array BUFFER. BUFFER[0] contains the amount of icons.
The parameter POINTERS requires a pointer to a pointer array where pointers to the icons are stored.
Example:
! icondemo3
#I_USED=1
INCLUDE StdIcon
DIM buf[2000] :! icon buffer
DIM &ptr[200] :! icon pointers
IF NOT I_LOADFILE!(*&&ptr,buf,4,"greek") THEN
PRINT "File 'greek' not found"
END 1
ENDIF |
To get direct access to an icon, use the pointer array. The following information about the icons is available in addition:
I_XSIZE | x size of icon |
I_YSIZE | y size of icon |
I_TAG | icon tag |
I_SIZE | size of icon in integer units |
The icon tag can be used for individual purposes, except for font archives used by FT_DRAW .
This example demonstrates how to use the icons:
nr=RND(buf[0]-1)
PRINT "nr.: ";
PRINT nr
PRINT "tag: ";
PRINT ~ptr[nr][#I_TAG]
PRINT "x size: ";
PRINT ~ptr[nr][#I_XSIZE]
PRINT "y size: ";
PRINT ~ptr[nr][#I_YSIZE]
DRAWICON ~ptr[nr], 80, 10 |
|