当前位置: 首页 > news >正文

公众号免费模板seo高效优化

公众号免费模板,seo高效优化,网站怎么改域名,做设计找素材的 网站有哪些在创建应用时,您可能需要TouchGFX中没有包含的控件。在创建应用时,您可能需要TouchGFX中没有包含的控件。但有时此法并不够用,当您需要全面控制帧缓冲时,您需要使用自定义控件法。 TouchGFX Designer目前不支持自定义控件的创建。…

在创建应用时,您可能需要TouchGFX中没有包含的控件。在创建应用时,您可能需要TouchGFX中没有包含的控件。但有时此法并不够用,当您需要全面控制帧缓冲时,您需要使用自定义控件法。

TouchGFX Designer目前不支持自定义控件的创建。 因此,您将需要手动写入自定义控件的代码,然后在视图的用户代码部分插入控件。

示例为自定义一个二维码控件

#ifndef QR_CODE_HPP
#define QR_CODE_HPP
#include <touchgfx/hal/Types.hpp>class QRCode
{
public:/* 获取该坐标值 */bool at(uint16_t x, uint16_t y) const;/* 获取宽度 */uint16_t getWidth() const;/* 获取高度 */uint16_t getHeight() const;
};#endif
#include <gui/model/QRCode.hpp>
#include <stdlib.h>bool QRCode::at(uint16_t x, uint16_t y) const
{srand(x*123456+y*getWidth()*23456789);for(int i = 0; i < 100; i++){srand(rand());}return ((rand() / (float)RAND_MAX) > 0.5f);
}uint16_t QRCode::getWidth() const
{return 16;
}uint16_t QRCode::getHeight() const
{return 16;
}
#ifndef QR_CODE_WIDGET_HPP
#define QR_CODE_WIDGET_HPP
#include <touchgfx/widgets/Widget.hpp>
#include <gui/model/QRCode.hpp>
#include <touchgfx/hal/Types.hpp>class QRCodeWidget : public touchgfx::Widget
{
public:QRCodeWidget();/* 绘制 */virtual void draw(const touchgfx::Rect& invalidatedArea) const;/* 获取实心区域 */virtual touchgfx::Rect getSolidRect() const;/* 设置二维码成员变量 */void setQRCode(QRCode *code);/* 设置缩放比例成员变量 */void setScale(uint8_t s);private:/* 更新二维码控件尺寸 */void updateSize();QRCode *code;uint8_t scale;
};#endif
#include <gui/common/QRCodeWidget.hpp>
#include <touchgfx/hal/HAL.hpp>QRCodeWidget::QRCodeWidget() : code(0),scale(1)
{
}void QRCodeWidget::setQRCode(QRCode *qrCode)
{code = qrCode;updateSize();
}void QRCodeWidget::draw(const touchgfx::Rect& invalidatedArea) const
{if(!code){return;}touchgfx::Rect absolute = getAbsoluteRect();uint16_t *framebuffer = touchgfx::HAL::getInstance()->lockFrameBuffer();for(int y = invalidatedArea.y; y < invalidatedArea.bottom(); y++){for(int x = invalidatedArea.x; x < invalidatedArea.right(); x++){framebuffer[absolute.x + x + (absolute.y + y) * touchgfx::HAL::DISPLAY_WIDTH] = code->at(x / scale, y / scale) ? 0x0000 : 0xffff;}}touchgfx::HAL::getInstance()->unlockFrameBuffer();
}touchgfx::Rect QRCodeWidget::getSolidRect() const
{return touchgfx::Rect(0,0,getWidth(), getHeight());
}void QRCodeWidget::setScale(uint8_t s)
{scale = s;updateSize();
}void QRCodeWidget::updateSize()
{if(code){setWidth(code->getWidth() * scale);setHeight(code->getHeight() * scale);}    
}
#include <gui/screen_screen/screenView.hpp>screenView::screenView()
{}void screenView::setupScreen()
{screenViewBase::setupScreen();myQRCodeWidget.setScale(10);myQRCodeWidget.setQRCode(&myQRCode);add(myQRCodeWidget);
}void screenView::tearDownScreen()
{screenViewBase::tearDownScreen();
}

运行模拟器:显示效果如下

http://www.hengruixuexiao.com/news/33684.html

相关文章:

  • 网站漂浮广告怎么做国内免费发布产品的平台
  • 网站做销售是斤么工作网络营销的真实案例分析
  • 淘宝网站怎么做的好坏创意设计
  • wordpress建站多用户搜索引擎调词平台
  • 盗取dede系统做的网站模板拓客引流推广
  • 衡水网站建设格公司强化防疫指导
  • 深圳制作网站软件搜索网站排行榜
  • 加强局网站建设it培训班出来工作有人要么
  • 万网域名管理网站淘宝搜索关键词排名查询工具
  • 网站备案时间有效期肇庆seo外包公司
  • 国际品牌的ui设计公司百度整站优化
  • 开县做网站夸克搜索网页版
  • 发卡网站搭建windows7系统优化工具
  • 如果熊掌号做的不好会不会影响网站线上卖货平台有哪些
  • 百度如何把网站做链接地址网络营销的推广方式都有哪些
  • phpwind 做企业网站网站服务器多少钱一年
  • 网站建设毕业设计中期检查中国最新军事新闻最新消息
  • 门户网站的好处seo 首页
  • 西安做网站微信公司留号码的广告网站不需要验证码
  • 汕头制作网站推荐深圳seo优化外包公司
  • 网站备案密码格式公司网站怎么优化
  • 长沙 建网站电话营销系统
  • 用国外服务器做赌博网站seo技巧seo排名优化
  • 星级酒店网站建设公司网络营销的重要性
  • 学校网站制作软件百度竞价多少钱一个点击
  • 大连餐饮网站建设百度知道官网首页登录入口
  • 上海网站建设定网络营销技巧和营销方法
  • 专门做心理测试的网站培训师资格证怎么考
  • 免费网站 推广网站seo搜索优化公司报价
  • 网站首屏做多大百度首页排名优化平台