TOUCHGFX CANVAS WIDGET (划线)

本文档通过touchgfx demo1示例详细介绍了如何在TouchGFX平台上使用Canvas Widget来绘制线条,展示了不同线条的实现方法,并提供执行界面的截图。
摘要由CSDN通过智能技术生成

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&#
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值