/******************************************************
**
** Sample Code ICON Displayer
**
** Please check this file before downloading to determine what will you need
** for this file to work.
** Please read the disclaimer before using this code.
**
** This file has to be compiled with SVGALIB System from a project file.
** SVGALIB.LIB is contained SVGACC25.ZIP
** Please check these files in the C MS-DOS archives in SimTelnet or Garbo.
**
** if you want to use another VGA system. Please change
** all the function referal to SVGALIB system to your own.
**
** Ahmad Hafiz:
** http://www.geocities.com/SiliconValley/Vista/2459
** cobra_ayaq@hotmail.com
**
** ps:// The difference from Bitmap displayer is, the program
** save the icon image into memory. Displayed to screen from
** memory allocated.
** ps:// Please set TAB to 2
**
*******************************************************/
#include
#include
#include
#include
#include
#include
#include
typedef unsigned char BYTE;
typedef unsigned int UINT;
typedef unsigned long DWORD;
typedef unsigned int WORD;
typedef signed long LONG;
typedef struct tagBITMAPINFOHEADER { /* bmih */
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;
typedef struct ICONDIR {
WORD idReserved;
WORD idType;
WORD idCount;
} ICONHEADER;
typedef struct IconDirectoryEntry {
BYTE bWidth;
BYTE bHeight;
BYTE bColorCount;
BYTE bReserved;
WORD wPlanes;
WORD wBitCount;
DWORD dwBytesInRes;
DWORD dwImageOffset;
} ICONDIRENTRY;
typedef struct tagICONS{
WORD x;
WORD y;
BYTE bWidth;
BYTE bHeight;
DWORD biClrUsed;
BYTE *palette;
BYTE *icXOR;
BYTE *icAND;
}ICONS;
unsigned getbits(unsigned x, int p, int n)
{ return(x>>(p+1-n)) & ~(~0<>2;
icon.palette[i*3+1]=fgetc(fp)>>2;
icon.palette[i*3+0]=fgetc(fp)>>2;
x=fgetc(fp);
}
/** refering from icons palette to system pallete **/
for(i=0;i-1;y--)
for(x=0;x-1;y--)
for(x=0;x               ( geocities.com/siliconvalley/vista/2459)                   ( geocities.com/siliconvalley/vista)                   ( geocities.com/siliconvalley)