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

网站首页 seo做那个网站大全

网站首页 seo,做那个网站大全,施工企业负责人带班检查计划,推广赚钱小程序TouchGFX的画布控件#xff0c;在使用相对较小的存储空间的同时保持高性能#xff0c;可提供平滑、抗锯齿效果良好的几何图形绘制。 TouchGFX 设计器中可用的画布控件#xff1a; LineCircleShapeLine Progress圆形进度条 存储空间分配和使用​ 为了生成反锯齿效果良好的…TouchGFX的画布控件在使用相对较小的存储空间的同时保持高性能可提供平滑、抗锯齿效果良好的几何图形绘制。 TouchGFX 设计器中可用的画布控件 LineCircleShapeLine Progress圆形进度条 存储空间分配和使用​ 为了生成反锯齿效果良好的复杂几何图形需要额外的存储空间。 为此CWR必须具有专门分配的存储缓冲区以便在渲染过程中使用。 CWR与TouchGFX的其余部分一样没有动态存储空间分配。 在TouchGFX Designer中可以在屏幕属性中重写画布缓冲区大小 需要的CWR存储空间的量取决于要在应用中绘制的最大图形大小。 但是您可以保留比最复杂形状所需内存空间更少的内存。 为了应对这种情况CWR将图形绘制分割成较小的帧缓存部分在这种情况下由于有时需要不止一次地渲染图像因此渲染时间稍长。 在模拟器模式下运行时可以更细致地查看存储空间消耗并进行微调。 只需向main.cpp中添加函数CanvasWidgetRenderer::setWriteMemoryUsageReport(true)具体操作如下 #include platform/hal/simulator/sdl2/HALSDL2.hpp #include touchgfx/hal/NoDMA.hpp #include common/TouchGFXInit.hpp #include gui_generated/common/SimConstants.hpp #include platform/driver/touch/SDL2TouchController.hpp #include touchgfx/lcd/LCD.hpp #include stdlib.h #include simulator/mainBase.hpp #include touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hppusing namespace touchgfx;#ifdef __linux__ int main(int argc, char** argv) { #else #include shellapi.h #ifdef _UNICODE #error Cannot run in unicode mode #endif int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {int argc;char** argv touchgfx::HALSDL2::getArgv(argc); #endiftouchgfx::NoDMA dma; //For windows/linux, DMA transfers are simulatedLCD lcd setupLCD();touchgfx::SDL2TouchController tc;touchgfx::HAL hal touchgfx::touchgfx_generic_inittouchgfx::HALSDL2(dma, lcd, tc, SIM_WIDTH, SIM_HEIGHT, 0, 0);setupSimulator(argc, argv, hal);// Ensure there is a console window to print to using printf() or// std::cout, and read from using e.g. fgets or std::cin.// Alternatively, instead of using printf(), always use// touchgfx_printf() which will ensure there is a console to write// to.//touchgfx_enable_stdio();CanvasWidgetRenderer::setWriteMemoryUsageReport(true);touchgfx::HAL::getInstance()-taskEntry(); //Never returnsreturn EXIT_SUCCESS; }自定义画布控件 实现自定义画布控件需要用下列函数实现新类 virtual bool drawCanvasWidget(const Rect invalidatedArea) const; virtual Rect getMinimalRect() const;drawCanvasWidget() 必须绘制自定义控件需要绘制的任何内容并且 getMinimalRect() 应该返回 Widget 中包含几何形状的实际矩形。 举例在10x10方块内部粗略实现一个菱形块 Diamond10x10.hpp#ifndef DIAMOND10X10_HPP #define DIAMOND10X10_HPP#include touchgfx/widgets/canvas/CanvasWidget.hpp #include touchgfx/widgets/canvas/Canvas.hppusing namespace touchgfx;class Diamond10x10 : public CanvasWidget { public:virtual Rect getMinimalRect() const{return Rect(0,0,10,10);}virtual bool drawCanvasWidget(const Rect invalidatedArea) const{Canvas canvas(this, invalidatedArea);canvas.moveTo(5,0);canvas.lineTo(10,5);canvas.lineTo(5,10);canvas.lineTo(0,5);return canvas.render(); // Shape is automatically closed} };#endifscreenView.hpp#ifndef SCREENVIEW_HPP #define SCREENVIEW_HPP#include gui_generated/screen_screen/screenViewBase.hpp #include gui/screen_screen/screenPresenter.hpp #include gui/common/Diamond10x10.hpp #include touchgfx/widgets/canvas/PainterRGB565.hppclass screenView : public screenViewBase { public:screenView();virtual ~screenView() {}virtual void setupScreen();virtual void tearDownScreen(); protected:private:Diamond10x10 box;PainterRGB565 myPainter; // For 16bpp displays };#endif // SCREENVIEW_HPPscreenView.cpp#include gui/screen_screen/screenView.hpp #include touchgfx/Color.hppscreenView::screenView() {}void screenView::setupScreen() {screenViewBase::setupScreen();myPainter.setColor(Color::getColorFromRGB(0xFF, 0x0, 0x0));box.setPosition(100,100,10,10);box.setPainter(myPainter);add(box); }void screenView::tearDownScreen() {screenViewBase::tearDownScreen(); } 运行模拟器效果如下意味着画布缓冲区大小可以调整到大于168字节即可 平铺位图 首先在模拟器中添加图片资源 然后修改程序 #ifndef DIAMOND10X10_HPP #define DIAMOND10X10_HPP#include touchgfx/widgets/canvas/CanvasWidget.hpp #include touchgfx/widgets/canvas/Canvas.hppusing namespace touchgfx;class Diamond10x10 : public CanvasWidget { public:virtual Rect getMinimalRect() const{return Rect(0,0,100,100);}virtual bool drawCanvasWidget(const Rect invalidatedArea) const{Canvas canvas(this, invalidatedArea);canvas.moveTo(50,0);canvas.lineTo(100,50);canvas.lineTo(50,100);canvas.lineTo(0,50);return canvas.render(); // Shape is automatically closed} };#endif#ifndef SCREENVIEW_HPP #define SCREENVIEW_HPP#include gui_generated/screen_screen/screenViewBase.hpp #include gui/screen_screen/screenPresenter.hpp #include gui/common/Diamond10x10.hpp #include touchgfx/widgets/canvas/PainterRGB565Bitmap.hppclass screenView : public screenViewBase { public:screenView();virtual ~screenView() {}virtual void setupScreen();virtual void tearDownScreen(); protected:private:Diamond10x10 box;PainterRGB565Bitmap bitmapPainter; };#endif // SCREENVIEW_HPP#include gui/screen_screen/screenView.hpp #include touchgfx/Color.hpp #include images/BitmapDatabase.hppscreenView::screenView() {}void screenView::setupScreen() {screenViewBase::setupScreen();bitmapPainter.setBitmap(touchgfx::Bitmap(BITMAP_TEST_ID));bitmapPainter.setTiled(true);box.setPosition(100,100,100,100);box.setPainter(bitmapPainter);add(box); }void screenView::tearDownScreen() {screenViewBase::tearDownScreen(); } 运行模拟器效果如下 定制绘图器 尽管TouchGFX提供一组预定义的画笔类涵盖了大多数用例场景但也可实现定制画笔 #ifndef REDPAINTER_HPP #define REDPAINTER_HPP#include touchgfx/widgets/canvas/AbstractPainterRGB565.hppusing namespace touchgfx;class StripePainter : public AbstractPainterRGB565 { public:virtual void paint(uint8_t* destination, int16_t offset, int16_t widgetX, int16_t widgetY, int16_t count, uint8_t alpha) const{if ((widgetY 2) 0){return; // Do not draw anything on line 0,1, 4,5, 8,9, etc.}uint16_t* framebuffer reinterpret_castuint16_t*(destination) offset;const uint16_t* const lineend framebuffer count;if (alpha 0xFF){do{*framebuffer 0xF800;} while (framebuffer lineend);}else{do{*framebuffer alphaBlend(0xF800, *framebuffer, alpha);} while (framebuffer lineend);}} };#endif#ifndef SCREENVIEW_HPP #define SCREENVIEW_HPP#include gui_generated/screen_screen/screenViewBase.hpp #include gui/screen_screen/screenPresenter.hpp #include gui/common/Diamond10x10.hpp #include gui/common/RedPainter.hppclass screenView : public screenViewBase { public:screenView();virtual ~screenView() {}virtual void setupScreen();virtual void tearDownScreen(); protected:private:Diamond10x10 box;StripePainter myPainter; };#endif // SCREENVIEW_HPP#include gui/screen_screen/screenView.hpp #include touchgfx/Color.hppscreenView::screenView() {}void screenView::setupScreen() {screenViewBase::setupScreen();box.setPosition(100,100,100,100);box.setPainter(myPainter);add(box); }void screenView::tearDownScreen() {screenViewBase::tearDownScreen(); } 运行模拟器效果如下
http://www.w-s-a.com/news/160991/

相关文章:

  • 赣州热门网站深圳龙岗做网站的公司
  • 中国最大的建站平台广告传媒公司取名
  • 深圳网站设计公司专业吗学动漫设计后悔死了
  • 企业网站形象建设网站开发入职转正申请书
  • 网站设计步骤济南建设网中标公告
  • 石佛营网站建设wordpress关健词
  • 您的网站空间即将过期建站 discuz
  • 上海简站商贸有限公司福州哪家专业网站设计制作最好
  • 博客网站开发流程苏州专业做网站的公司哪家好
  • 四川手机网站建设西安 网站 高端 公司
  • 织梦大气绿色大气农业能源化工机械产品企业网站源码模版建筑工程知识零基础
  • 广州番禺网站公司v2017网站开发
  • 微信公众号怎么做微网站wordpress和dz
  • 西部数码网站管理助手 301福州搜索优化实力
  • 响应式网站介绍页面模板功能找不到
  • 公司网站如何seo自己做资讯网站
  • 天津网站建设软件开发招聘企业信用信息查询公示系统上海
  • 网站备案中做正品的网站
  • 网站建设0基础学起青海企业网站开发定制
  • 网站定制项目上海快速建站
  • 大型视频网站建设方案东莞企业网站建设开发
  • 西安php网站制作可以用AI做网站上的图吗
  • 网站开发工程师和前端企业网络推广公司
  • 泉州开发网站的公司有哪些电脑网页翻译
  • 河北省建设机械会网站首页刚做的网站怎么收录
  • 什么网站专门做自由行的framework7做网站
  • 网页设计与网站建设书籍包头住房与城乡建设局网站
  • 重庆网站建设平台免费猎头公司收费收费标准和方式
  • 形象设计公司网站建设方案书打开一个不良网站提示创建成功
  • 网站手机页面如何做网站关键字 优帮云