?? myico.h
字號:
/* ==================================================== */
/* */
/* 學(xué)生宿舍管理系統(tǒng)Ver 1.00.1 源代碼 */
/* 文件名: MyIco.h */
/* 作用: 主要負責(zé)將一個圖標(biāo)(Ico)文件畫在屏幕上 */
/* 這里偷了點懶,程序默認(rèn)圖標(biāo)是16*16的16色圖標(biāo) */
/* 版權(quán)所有 (c) 2007 張元龍 保留所有權(quán)利 */
/* */
/* ==================================================== */
#include <stdio.h>
#include <string.h>
#ifndef IcoDefined
#define IcoDefined
#define bool char
#define true 1
#define false 0
typedef unsigned short word,Word,WORD;
typedef unsigned long DWord,dword,Dword,DWORD;
typedef unsigned char byte,Byte,BYTE;
typedef long LONG;
const byte convert[16]={0,4,2,6,1,5,3,7,8,12,10,14,9,13,11,15};
typedef byte TIcoBuf[0x80];
void DrawIco(TIcoBuf IcoBuf,int x,int y){
int i,j;
byte hb,lb;
for (i=0;i<16;i++)
for (j=0;j<8;j++){
lb=IcoBuf[i*8+j] & 0xF;
hb=IcoBuf[i*8+j] >>4;
if (hb!=0) putpixel(x+j*2,y+15-i,hb);
if (lb!=0) putpixel(x+j*2+1,y+15-i,lb);
}
}
void LoadIcoFile(char *filename,TIcoBuf IcoBuf){
FILE *FP;
int i;
byte hb,lb;
if ((FP=fopen(filename,"r"))==NULL) {
printf("Cannot open the icon files!\n");
getch();
exit(0);
}
fseek(FP,0x7E,SEEK_SET);
fread(IcoBuf,0x80,1,FP);
fclose(FP);
for (i=0;i<0x80;i++){
lb=convert[IcoBuf[i] & 0xF];
hb=convert[IcoBuf[i] >> 4];
IcoBuf[i]=lb | (hb <<4);
}
}
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -