資源簡(jiǎn)介
Linux開(kāi)發(fā)板下bmp圖片顯示封裝函數(shù),lcd的大小為800*480,有需要自己應(yīng)該可以改吧
代碼片段和文件信息
#include
#include?
#include?
#include?
#include?
#include?
#include
#include?
#include?
int?show_bmp(unsigned?int?x?unsigned?int?y??char?*name);
char?Check_Is_BMP(const?char?*path);
int?main(int?argcchar?*argv[])
{
unsigned?int?re;
if(argc==2)
{
if(Check_Is_BMP(argv[1])==0)
show_bmp(00argv[1]);
else
{
printf(“Invalid?argument!\n“);
printf(“Please?try?./bmp_show?xxx.bmp?or?./bmp_show?x?y?wide??hight?xxx.bmp?\n“);
return?-1;
}
}
else?if(argc?==?4)
{
if(Check_Is_BMP(argv[3])==0?&&?strtoul(argv[1]NULL10)<800?&&?strtoul(argv[2]NULL10)<480)
{
show_bmp(strtoul(argv[1]NULL10)strtoul(argv[2]NULL10)argv[3]);
}
評(píng)論
共有 條評(píng)論