国产精品无码一区二区在线,办公室激情呻吟无码A片漫画,影音先锋 av天堂,欧洲女人牲交性开放视频

首頁 > 技術(shù)支持 > 應(yīng)用與案例 > 正文
第四講 單片機驅(qū)動彩色液晶屏 控制RA8889軟件:繪圖 作者:BW.SU   發(fā)表日期:2023-12-31   來源:菱致電子   瀏覽:
目錄
第四講 單片機驅(qū)動彩色液晶屏 控制RA8889軟件:繪圖
 

如何通過RA8889 / RA8876內(nèi)建的圖形驅(qū)動引擎來繪圖?
RA8889內(nèi)建豐富的圖形繪制函數(shù),包括:畫線、畫框、矩形、三角形、橢圓形、填色等等,各種常用的幾何圖形均包含了。

相比采用專用的GUI來說繪圖速度會更快,比如繪制一個矩形,調(diào)用以下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);

函數(shù)名后面加上“_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);

上方幾個函數(shù)名后面加“_Fill”表示填充功能。

這些繪圖API十分簡潔,即使采用SPI串口方式與RA8889/RA8876進行通信,速度也是極快!也因此采用STM32F103C6T6 / STM32F103C8T6來作為主控MCU,也是也十分輕松!當然更低端的51單片機一樣可以作為控制!

 第四講 THE END


分享到:

相關(guān)熱詞搜索:RA8889 TFT控制芯片 繪圖API

上一篇:第三講 單片機驅(qū)動彩色液晶屏 控制RA8889軟件:如何初始化
下一篇:第五講 單片機驅(qū)動彩色液晶屏 顯示文字:Part1.內(nèi)部字庫

>>延伸閱讀:0

  • · 如何解決MCU與RA8889等液晶控制芯片的SPI通信問題 [2020-03-04]
  • · RA8889配套上位機使用簡介 [2020-09-01]
  • · 介紹一顆51單片機就可以進行視頻解碼的芯片方案1366x768 [2020-09-07]
  • · RA88xx系列對顯存直接讀寫點的方法 [2020-09-10]
  • · NAND FLASH的調(diào)用 [2020-09-14]