Difference between revisions of "Tft.fillRoundRect()"

From Microduino Wiki
Jump to: navigation, search
(Created page with "<pre style="color:green"> tft.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) </pre> *'''作Effect''':<br> Draw a solid square wit...")
 
Line 50: Line 50:
  
  
[[http://wiki.microduino.cn/index.php/TFT_ST7735%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C/zh Return to TFT_ST7735 Grammar Handbook]]
+
[[https://wiki.microduino.cc/index.php/TFT_ST7735_Grammar_Handbook Return to TFT_ST7735 Grammar Handbook]]

Revision as of 04:35, 18 July 2016

tft.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
  • 作Effect:

Draw a solid square with round corners on the TFT screen.


  • Parameterd:

x0:x coordinate of the starting point

y0:y coordinate of the starting point

w:the length of the square

h:the width of the square

radius:the radius of the round corners

color:the color of the square


  • 例子:
#define sclk 13
#define mosi 11
#define cs   5
#define dc   4
#define rst  -1  // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
#endif

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);

void setup(void) {
  tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
  tft.fillScreen(ST7735_BLACK);
  tft.fillRoundRect(30, 40, 60, 65, 20, ST7735_GREEN);
}

void loop() {  }


[Return to TFT_ST7735 Grammar Handbook]