資源簡介
做的嵌入式課程設計—電子鋼琴,代碼齊全,含有bmp格式圖片,及剪切過得音源。

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“mmap_lcd.h“
int?seek(char?*file1)
{
int?fd?=?open(file1O_RDWR);
if(fd?==?-1)
{
perror(“open?bmp?error“);
return?-1;
}
int?i?=?0;
unsigned?char?ch[4]?=?{0};
lseek(fd0x02SEEK_SET);
read(fdch4);
int?len?=?ch[3]<<24?|?ch[2]<<16?|?ch[1]<<8?|?ch[0];
lseek(fd0x12SEEK_SET);
read(fdch4);
int?w?=?ch[3]<<24?|?ch[2]<<16?|?ch[1]<<8?|?ch[0];
lseek(fd0x16SEEK_SET);
read(fdch4);
int?h?=?ch[3]<<24?|?ch[2]<<16?|?ch[1]<<8?|?ch[0];
lseek(fd0x1cSEEK_SET);
read(fdch2);
int?bits_pix?=??ch[1]<<8?|?ch[0];
lseek(fd0x0aSEEK_SET);
read(fdch4);
int?d_off?=?ch[3]<<24?|?ch[2]<<16?|?ch[1]<<8?|?ch[0];
int?pix_size?=?w*h*bits_pix/8;
unsigned?char?*data?=?(unsigned?char?*)malloc(pix_size);
lseek(fdd_offSEEK_SET);
read(fddatapix_size);
unsigned?char?argb;
unsigned?int?color;
unsigned?char?*?tmp?=?data;
int?xy;
for(y=h-1;y>=0;y--)
{
for(x=0;x {
b?=?*tmp++;
g?=?*tmp++;
r?=?*tmp++;
a?=?bits_pix==24?0:*tmp++;
color?=?a<<24?|?r<<16?|?b<<8?|?g;
lcd_draw_point(xycolor);
}
}
free(data);
close(fd);
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????1152054??2018-05-31?14:02??code\code\images\piano.bmp
?????文件???????1244??2018-05-31?13:58??code\code\lseek.c
?????文件?????????77??2018-05-31?13:58??code\code\lseek.h
?????文件???????9462??2018-05-31?13:58??code\code\main
?????文件????????956??2018-05-31?14:56??code\code\main.c
?????文件????????792??2018-05-31?13:58??code\code\mmap_lcd.c
?????文件????????209??2018-05-31?13:58??code\code\mmap_lcd.h
?????文件??????25748??2018-05-31?14:47??code\code\sounds\1.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\10.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\11.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\12.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\2.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\3.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\4.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\5.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\6.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\7.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\8.mp3
?????文件??????25748??2018-05-31?14:47??code\code\sounds\9.mp3
?????文件?????271308??2018-05-31?14:52??code\code\sounds.zip
?????目錄??????????0??2018-05-31?14:02??code\code\images
?????目錄??????????0??2018-05-31?14:49??code\code\sounds
?????目錄??????????0??2018-05-31?14:54??code\code
?????目錄??????????0??2018-06-02?18:53??code
?????文件????1152054??2018-05-31?14:02??code\images\piano.bmp
?????文件???????1244??2018-05-31?09:39??code\lseek.c
?????文件?????????77??2018-05-31?09:39??code\lseek.h
?????文件????????187??2018-05-31?10:44??code\main.c
?????文件????????792??2018-05-31?09:39??code\mmap_lcd.c
?????文件????????209??2018-05-31?09:39??code\mmap_lcd.h
............此處省略18個文件信息
評論
共有 條評論