GrafX2 2.9.3227
The ultimate 256-color painting program
Bitmap and icon files

.BMP/.ICO/.CUR files from OS/2 or Windows More...

+ Collaboration diagram for Bitmap and icon files:

Data Structures

struct  T_BMP_Header
 BMP file header. More...
 
struct  T_ICO_ImageEntry
 

Macros

#define LOAD_BMP_PIXEL_FLAG_TOP_DOWN   0x01
 rows are stored from the top to the bottom (standard for BMP is from bottom to the top) More...
 
#define LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE   0x02
 We are decoding the AND-mask plane (transparency) of a .ICO file. More...
 

Functions

void Test_BMP (T_IO_Context *context, FILE *file)
 Test for BMP format. More...
 
static byte Bitmap_mask (dword pixel, dword mask, int bits, int shift)
 extract component value and properly shift it. More...
 
static void Load_BMP_Palette (T_IO_Context *context, FILE *file, unsigned int nb_colors, int is_rgb24)
 Load the Palette for 1 to 8bpp BMP's. More...
 
static void Load_BMP_Pixels (T_IO_Context *context, FILE *file, unsigned int compression, unsigned int nbbits, int flags, const dword *mask)
 
void Load_BMP (T_IO_Context *context)
 Load BMP file. More...
 
void Save_BMP (T_IO_Context *context)
 Save BMP file. More...
 
void Test_ICO (T_IO_Context *context, FILE *file)
 
void Load_ICO (T_IO_Context *context)
 
void Save_ICO (T_IO_Context *context)
 

Detailed Description

.BMP/.ICO/.CUR files from OS/2 or Windows

We support OS/2 files and windows BITMAPINFOHEADER, BITMAPV4HEADER, BITMAPV5HEADER files.

.ICO with PNG content are also supported

Macro Definition Documentation

◆ LOAD_BMP_PIXEL_FLAG_TOP_DOWN

#define LOAD_BMP_PIXEL_FLAG_TOP_DOWN   0x01

rows are stored from the top to the bottom (standard for BMP is from bottom to the top)

◆ LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE

#define LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE   0x02

We are decoding the AND-mask plane (transparency) of a .ICO file.

Function Documentation

◆ Test_BMP()

◆ Bitmap_mask()

static byte Bitmap_mask ( dword  pixel,
dword  mask,
int  bits,
int  shift 
)
static

extract component value and properly shift it.

Referenced by Load_BMP_Pixels().

◆ Load_BMP_Palette()

static void Load_BMP_Palette ( T_IO_Context context,
FILE *  file,
unsigned int  nb_colors,
int  is_rgb24 
)
static

Load the Palette for 1 to 8bpp BMP's.

References T_Config::Clear_palette, Config, File_error, MIN, T_IO_Context::Palette, and Read_bytes().

Referenced by Load_BMP(), and Load_ICO().

◆ Load_BMP_Pixels()

◆ Load_BMP()

◆ Save_BMP()

◆ Test_ICO()

void Test_ICO ( T_IO_Context context,
FILE *  file 
)

References File_error, and Read_word_le().

◆ Load_ICO()

◆ Save_ICO()