*输出字模的函数*/void _draw_model(char *pdata, int w, int h, int x, int y, int color){ int i; /* 控制行 */ int j; /* 控制一行中的8个点 */ int k; /* 一行中的第几个“8个点”了 */ int nc; /* 到点阵数据的第几个字节了 */ int cols; /* 控制列 */ BYTE static mask[8]={128, 64, 32, 16, 8, 4, 2, 1}; /* 位屏蔽字 */
w = (w + 7) / 8 * 8; /* 重新计算w */ nc = 0;
for (i=0; i<h; i++) { cols = 0; for (k=0; k<w/8; k++) { for (j=0; j<8; j++) { if (pdata[nc]&mask;[j]) putpixel(x+cols, y+i, color); cols++; } nc++; } }}