- 目录第四讲 单片机驱动彩色液晶屏 控制RA8889软件:绘图第六讲 单片机驱动彩色液晶屏 控制RA8889软件:显示文字:Part2.外接字库
第七讲 单片机驱动彩色液晶屏 控制RA8889软件:显示文字:Part3.自建字库
第八讲 单片机驱动彩色液晶屏 控制RA8889软件:显示图片
第九讲 单片机驱动彩色液晶屏 控制RA8889软件:认识显存并进行读、写、复制
第十讲 单片机驱动彩色液晶屏 控制RA8889软件:图像运算
第十一讲 单片机驱动彩色液晶屏 控制RA8889软件:播放avi视频
第十二讲 单片机驱动彩色液晶屏 如何打包bin档
第十三讲 单片机驱动彩色液晶屏 bin档的烧录方法
如何通过RA8889 / RA8876内建的图形驱动引擎来绘图?
RA8889内建丰富的图形绘制函数,包括:画线、画框、矩形、三角形、椭圆形、填色等等,各种常用的几何图形均包含了。
相比采用专用的GUI来说绘图速度会更快,比如绘制一个矩形,调用以下API即可,相当简单!
void Draw_Square_Fill(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2);
实例:
Draw_Square_Fill(0xFF0000,0,0,799,479);
作用:绘制一个800x480的填充矩形,硬件加速,相比GUI软件填充会快很多!常用绘图功能:
(1)打点void putPixel(unsigned short x,unsigned short y,unsigned long color);
(2)直线void Draw_Line(unsigned long LineColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2);
(3)三角形void Draw_Triangle(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3);
void Draw_Triangle_Fill(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3);函数名后面加上“_Fill”表示填充,下同。
(4)矩形
void Draw_Square(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2);
void Draw_Square_Fill(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2);
(5)圆弧倒角矩形void Draw_Circle_Square(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short R,unsigned short Y_R);
void Draw_Circle_Square_Fill(unsigned long ForegroundColor,unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short R,unsigned short Y_R);
(6)圆形void Draw_Circle(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short R);
void Draw_Circle_Fill(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short R);
(7)椭圆形void Draw_Ellipse(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);
void Draw_Ellipse_Fill(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);
(8)圆弧形void Draw_Left_Up_Curve(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);
void Draw_Left_Down_Curve(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);
void Draw_Right_Up_Curve(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);
void Draw_Right_Down_Curve(unsigned long ForegroundColor,unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R);上方几个函数名后面加“_Fill”表示填充功能。
这些绘图API十分简洁,即使采用SPI串口方式与RA8889/RA8876进行通信,速度也是极快!也因此采用STM32F103C6T6 / STM32F103C8T6来作为主控MCU,也是也十分轻松!当然更低端的51单片机一样可以作为控制!
第四讲 THE END
分享到:
上一篇:第三讲 单片机驱动彩色液晶屏 控制RA8889软件:如何初始化
下一篇:第五讲 单片机驱动彩色液晶屏 显示文字:Part1.内部字库
>>延伸阅读:0