求助一个c语言编程问题(关于用按键实现bmp图像的连续显示)
void demoTask(void){
T_Message RecvMsg;
OSD_RECT TextRect;
INT8S HintStr[300];
int bmp_count=0;/////////////////////这里设置的一个变量
TextRect.x = 300;
TextRect.y = 540;
TextRect.width = 300;
TextRect.height = 30;
while(1)
{
DTOS_DRV_ReceiveMessage( Test_queueID, &RecvMsg);
DrawRoundRectangle(TextRect, 0x0060a0d0, 0, GRADE_NONE, Small_Round);
switch(RecvMsg.param0)
{
case MSG_PGDOWN:
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[PgDn]键", ALIGNED_CENTER);
break;
case MSG_PGUP:
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[PgUp]键", ALIGNED_CENTER);
break;
case MSG_KeyUP:
bmp_count--;/////////////这里用到这个变量
showbmp(&bmp_count);
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[↑]键", ALIGNED_CENTER);
break;
case MSG_KeyDOWN:
bmp_count++;
showbmp(&bmp_count);
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[↓]键", ALIGNED_CENTER);
break;
case MSG_KeyLEFT:
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[←]键", ALIGNED_CENTER);
break;
case MSG_KeyRIGHT:
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[→]键", ALIGNED_CENTER);
break;
case MSG_KeySELECT:
GUIDrawAlignedText(0xff000000, 24, TextRect, "您按下了[回车]键", ALIGNED_CENTER);
break;
default:
sprintf(HintStr, "您按的键盘值为[0x%x]!", RecvMsg.param0);
GUIDrawAlignedText(0xff000000, 24, TextRect, HintStr, ALIGNED_CENTER);
break;
}
}
void showbmp(*which)
{
FILE *fp;
INT8U len;
INT8S* filename;
len=strlen(File[*which]);
filename=(char*)malloc(len+1);
strcpy(filename,File[*which]);
if((fp=(FILE*)fopen(filename,"rb")==NULL)////////////////////这里老是有错。。
{
printf("\ncan not open!\n");
exit(1);
}
if((fgetc(fp)!=0x42)||fgetc(fp)!=0x4d)
{
exit(1);
}
请问这里究竟应该怎么做?
十分紧急,如果需要源程序的话请留言。万分感谢
本人新手,技术略搓