說明
在屏幕上畫一個圓圈。
圓是相對於其中心點繪製的,這意味著總直徑將始終為奇數。
用法
screen.circle(xPos, yPos, radius);
參數
xPos: int, 圓心在x軸上的位置 yPos: int, 圓心在y軸上的位置 radius: int, 圓的半徑
返回
int:屏幕的寬度(以像素為單位)
示例
#include <SPI.h>
#include <TFT.h> // Arduino TFT library
#define cs 10
#define dc 9
#define rst 8
TFT screen = TFT(cs, dc, rst);
void setup() {
// initialize the screen
screen.begin();
// make the background black
screen.background(0,0,0);
// set the stroke color to white
screen.stroke(255,255,255);
// set the fill color to grey
screen.fill(127,127,127);
// draw a circle in the center of screen
screen.circle(screen.width()/2, screen.height()/2, 10);
}
void loop() {
}
相關用法
- Arduino TFT - PImage.width()用法及代碼示例
- Arduino TFT - height()用法及代碼示例
- Arduino TFT - background()用法及代碼示例
- Arduino TFT - PImage.height()用法及代碼示例
- Arduino TFT - line()用法及代碼示例
- Arduino TFT - EsploraTFT用法及代碼示例
- Arduino TFT - loadImage()用法及代碼示例
- Arduino TFT - PImage用法及代碼示例
- Arduino TFT - width()用法及代碼示例
- Arduino TFT - TFT用法及代碼示例
- Arduino TFT - image()用法及代碼示例
- Arduino TFT - point()用法及代碼示例
- Arduino TFT - rect()用法及代碼示例
- Arduino TFT - begin()用法及代碼示例
- Arduino TFT - stroke()用法及代碼示例
- Arduino TFT - noStroke()用法及代碼示例
- Arduino TFT - fill()用法及代碼示例
- Arduino TFT - PImage.isValid()用法及代碼示例
- Arduino TFT - setTextSize()用法及代碼示例
- Arduino TFT - noFill()用法及代碼示例
- Arduino TFT - text()用法及代碼示例
- Arduino long用法及代碼示例
- Arduino Arduino_EMBRYO_2 - setLengthXY()用法及代碼示例
- Arduino ~用法及代碼示例
- Arduino ArduinoBLE - bleDevice.advertisedServiceUuidCount()用法及代碼示例
注:本文由純淨天空篩選整理自arduino.cc大神的英文原創作品 TFT - circle()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。