LCDDrawLine(x1,y1,x2,y1,color); LCDDrawLine(x1,y1,x1,y2,color); LCDDrawLine(x1,y2,x2,y2,color); LCDDrawLine(x2,y1,x2,y2,color); } //在指定位置画一个指定大小的圆 //(x,y):中心点 //r :半径 void LCDDrawCircle(u16 x0,u16 y0,u8 r,u16 color) { int a,b; int di;...
绘制实心矩形时,直接使用ILI9341_OpenWindow函数根据输入参数设置显示矩形窗口, 然后根据实心矩形的像素点个数调用ILI9341_FillColor 即可完成绘制;而绘制空心矩形时,实质上是绘制四条边框线,它调用ILI9341_DrawLine 函数绘制,ILI9341_DrawLine 函数的输入参数是用于表示直接的两个坐标点(x1,y1)与(x2,y2),该函数内...
voidLCD_DrawLine(uint16_tx1,uint16_ty1,uint16_tx2,uint16_ty2,unsignedintcolor){uint16_tt;intxerr=0,yerr=0,delta_x,delta_y,distance;intincx,incy,uRow,uCol;delta_x=x2-x1;//计算坐标增量delta_y=y2-y1;uRow=x1;uCol=y1;if(delta_x>0)incx=1;//设置单步方向elseif(delta_x==0)in...
void LCD_DrawLine_Color(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color); //指定颜色画线 void LCD_DrowSign(uint16_t x, uint16_t y, uint16_t color); //画十字标记 void LCD_DrawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); /...
void LCD_DrawLine(u16x0,u16y0,u16x1,u16y1,u16color) {u16xm =0,ym =0;u16step =0;if(x1< x0)//如果起点在终点左边,起点终点互换位置,确保从左到右划线{ xm = x0; x0 = x1; x1 = xm; ym = y0; y0 = y1; y1 = ym; }
LCD_DrawLine(x2-1,y1+1,x2-1,y2, Color); //V LCD_DrawLine(x2 ,y1 ,x2,y2, Color); //V } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 显示纯色背景与图片 我们已经做到了全屏显示,那么纯色背景的显示就很简单了: ...
POINT_COLOR=GRAY; e=abs(x2-x1)+abs(y2-y1); while(e!=0) { if(fi1>=0) { x=xi-1; fi1=fi1+2*(x0-xi)+1; LCD_DrawLine(xi,yi,x,y,5); xi=x; e--; } else { y=yi-1; fi1=fi1+2*(y0-yi)+1; LCD_DrawLine(xi,yi,x,y,5); ...
LCD_WR_DATA(color); } } } void LCD_DrawPoint(uint16_t x,uint16_t y,uint16_t color) { LCD_Address_Set(x,y,x,y);//???ù??λ?? LCD_WR_DATA(color); } void LCD_DrawLine(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t color) ...
LCD_WriteString( x, y, BufStr, TEXT_COLOR ); strcpy( BufStr, '嵌入式网络模块' ); x = (128-strlen(BufStr)*8)/2; y = 24; LCD_WriteString( x, y, BufStr, BK_COLOR ); // 反显 sleep( 1 ); // 画线 LCD_DrawLine( 0, 42, 127, 42, TEXT_COLOR ); ...
POINT_COLOR=GRAY; e=abs(x2-x1)+abs(y2-y1); while(e!=0) { if(fi1>=0) { x=xi-1; fi1=fi1+2*(x0-xi)+1; LCD_DrawLine(xi,yi,x,y,5); xi=x; e--; } else { y=yi-1; fi1=fi1+2*(y0-yi)+1; LCD_DrawLine(xi,yi,x,y,5); yi=y; e--; } } }void arc...