void LCD_DrawBmp(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1, unsigned char* BMP) { unsigned int j=0; unsigned char x,y; if(y1%8==0) y=y1/8; else y=y1/8+1; for(y=y0;y<y1;y++) { LCD_Set_Pos(x0,y); for(x=x0;x<x1;x++) { LCD_WrDat(BMP[j++]); } } }
时间: 2023-07-15 14:14:29 浏览: 94
这是一个用于在 LCD 上绘制 BMP 图像的函数。它接收四个参数:起始坐标 (x0, y0) 和结束坐标 (x1, y1),以及指向 BMP 图像数据的指针 BMP。
该函数通过循环遍历 BMP 数据,并将其逐个写入 LCD 的相应位置上,实现了在 LCD 上绘制 BMP 图像的功能。其中,y1 可能不是 8 的倍数,因此需要进行特殊处理。如果 y1 不是 8 的倍数,那么需要将其加 1 后再除以 8,以保证能够正确地显示 BMP 图像。
相关问题
..\USER\GUI.c(771): error: #147-D: declaration is incompatible with "void Gui_Drawbmp16(u16, u16, const unsigned char *)" (declared at line 73 of "..\USER\gui.h")
这个错误是由于在GUI.c文件的第771行,你声明的函数与gui.h头文件中的声明不兼容所导致的。具体来说,你在GUI.c中的函数声明与gui.h中的函数声明不匹配。
要解决这个问题,你需要确保GUI.c文件中的函数声明与gui.h头文件中的声明完全一致。检查一下GUI.c文件中对应函数的参数类型和返回类型是否与gui.h文件中的一致。如果不一致,需要进行修改,使它们匹配。
另外,还要确保在GUI.c文件中包含了正确的头文件。检查一下是否包含了gui.h头文件,如果没有,需要添加上去。
如果你能提供GUI.c和gui.h文件的相关代码,我可以更具体地帮你解决这个问题。
OLED_DrawBMP(43, 0, uint8_t x1, uint8_t y1, uint8_t * BMP,0)
OLED_DrawBMP是一个函数,它可以在OLED屏幕上显示一个BMP格式的图片。该函数有五个参数,分别是图片的左上角坐标x0和y0,图片的右下角坐标x1和y1,以及图片的数据数组BMP。在引用中提供的代码中,该函数被调用并传入了参数,用于在OLED屏幕上显示一个图片。其中,43和0是图片的左上角坐标,x1和y1是图片的右下角坐标,BMP[]是图片的数据数组,0是图片的颜色。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)