当前位置: 首页>>代码示例>>C++>>正文


C++ LcdPanel::drawRectangle方法代码示例

本文整理汇总了C++中LcdPanel::drawRectangle方法的典型用法代码示例。如果您正苦于以下问题:C++ LcdPanel::drawRectangle方法的具体用法?C++ LcdPanel::drawRectangle怎么用?C++ LcdPanel::drawRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LcdPanel的用法示例。


在下文中一共展示了LcdPanel::drawRectangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rectTest

    void rectTest() {

      uint32_t i,start;
      Rectangle rc;

      prompt("Rectangle test");

      for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getYmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        _gl->setForeground(rand());
        _gl->fillRectangle(rc);
      }

      _gl->clearScreen();

      for(i=0,start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;i++) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getYmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        _gl->setForeground(rand());
        _gl->drawRectangle(rc);

        if(i % 1000 ==0)
          _gl->clearScreen();
      }
    }
开发者ID:ADTL,项目名称:stm32plus,代码行数:34,代码来源:r61523_f051.cpp

示例2: rectTest

    void rectTest() {

      int i;
      Rectangle rc;

      prompt("Rectangle test");

      for(i=0;i<1500;i++) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getXmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        _gl->setForeground(rand());
        _gl->fillRectangle(rc);
      }

      _gl->clearScreen();

      for(i=0;i<10000;i++) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getXmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        _gl->setForeground(rand());
        _gl->drawRectangle(rc);

        if(i % 1000 ==0)
          _gl->clearScreen();
      }
    }
开发者ID:0x00f,项目名称:stm32plus,代码行数:34,代码来源:hx8347a.cpp

示例3: rectTest

    void rectTest() {

      Rectangle rc;
      uint32_t start;

      prompt("Rectangle test");

      for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getXmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        if(rc.Width>0 && rc.Height>0) {
          _gl->setForeground(rand());
          _gl->fillRectangle(rc);
        }
      }

      _gl->clearScreen();

      for(start=MillisecondTimer::millis();MillisecondTimer::millis()-start<5000;) {

        rc.X=(rand() % _gl->getXmax()/2);
        rc.Y=(rand() % _gl->getXmax()/2);
        rc.Width=rand() % (_gl->getXmax()-rc.X);
        rc.Height=rand() % (_gl->getYmax()-rc.Y);

        _gl->setForeground(rand());
        _gl->drawRectangle(rc);
      }
    }
开发者ID:ADTL,项目名称:stm32plus,代码行数:33,代码来源:st7783.cpp

示例4: drawBox

	void drawBox(const char *label, int16_t X_location,int16_t Y_location , Rectangle* touchArea) {
		// create a touch button at location specified by location
		// and display the button on the screen with the specified label
		// touch button are constant size for now
		touchArea->X=X_location;
		touchArea->Y=Y_location;
		touchArea->Height=40;
		touchArea->Width=80;

		lcd->drawRectangle(*touchArea);
		// find the suitable location for the label and display it
		Size stringSize = lcd->measureString(*_font,label);
		Point labelLocation;
		labelLocation.X = touchArea->Width/2-stringSize.Width/2+X_location;
		labelLocation.Y = touchArea->Height/2-stringSize.Height/2+Y_location;
		// debug purpose: we want to make sure the location is still visible
		// even if it's too big for the box
		if (labelLocation.X > 0 && labelLocation.Y>0)
			*lcd << labelLocation << label;

	}
开发者ID:glocklueng,项目名称:DataLogger_Wifi_Touch_stm32plus,代码行数:21,代码来源:Access.cpp


注:本文中的LcdPanel::drawRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。