1.draw line (参考例程 touchgfx demo1)
demo1 实现了多种线条的绘制
实现的文件为
void Screen1View::setupScreen()
{
// Screen1ViewBase::setupScreen();
//Screen1ViewBase::setupScreen();
// Place the graph on the screen
graph.setXY(20, 20);
// Set the outer dimensions and color of the graph
graph.setup(440, 200, Color::getColorFrom24BitRGB(0xFF, 0, 0));
// Set the range for the x and y axis of the graph. That is
// the max and min x/y value that can be displayed inside the
// dimension of the graph.
graph.setRange(0, 50, 0, 200);
// Set the line width in pixels
graph.setLineWidth(3);
add(graph);
}
void Screen1View::handleTickEvent()
{
// Number of ticks between inserting a point in the graph
int interval = 5;
tickCounter&#