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


C++ GUI_FillRect函数代码示例

本文整理汇总了C++中GUI_FillRect函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_FillRect函数的具体用法?C++ GUI_FillRect怎么用?C++ GUI_FillRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _Draw

/********************************************************************
*
*       _Draw
*
* Function description
*   Draws some coloured output to the current device (display or memory device)
*/
static void _Draw(void) {
  int i;
  GUI_SetBkColor(GUI_YELLOW);
  GUI_ClearRect(0, 75, 319, 138);
  GUI_SetColor(GUI_RED);
  GUI_SetFont(&GUI_Font32B_ASCII);
  GUI_DispStringHCenterAt("Printing demo", 160, 75);
  for (i = 0; i < 12; i += 2) {
    GUI_SetColor(GUI_GREEN);
    GUI_DrawRect(5 + i, 80 + i, 50 - i, 101 - i);
    GUI_SetColor(GUI_BLUE);
    GUI_DrawRect(269 + i, 80 + i, 314 - i, 101 - i);
  }
  for (i = 0; i < 32; i += 8) {
    GUI_SetColor(GUI_BLUE);
    GUI_FillRect(0, 107 + i, 319, 110 + i);
    GUI_SetColor(GUI_YELLOW);
    GUI_FillRect(0, 111 + i, 319, 114 + i);
  }
  i = 8;
  _DrawBitmap(&bmTestPicture1, i +   0, 111, 0, 0);
  _DrawBitmap(&bmTestPicture1, i +  35, 111, 1, 0);
  _DrawBitmap(&bmTestPicture1, i +  70, 111, 0, 1);
  _DrawBitmap(&bmTestPicture2, i + 105, 111, 0, 0);
  _DrawBitmap(&bmTestPicture2, i + 140, 111, 1, 0);
  _DrawBitmap(&bmTestPicture4, i + 175, 111, 0, 0);
  _DrawBitmap(&bmTestPicture4, i + 210, 111, 1, 0);
  _DrawBitmap(&bmTestPicture8, i + 245, 111, 0, 0);
  _DrawBitmap(&bmTestPicture8, i + 280, 111, 1, 0);
}
开发者ID:caicry,项目名称:uFrame,代码行数:37,代码来源:MEMDEV_Printing.c

示例2: _Paint

static void _Paint(FRAMEWIN_Obj* pObj) {
  WM_HWIN hWin = WM_GetActiveWindow();
  int xsize = WM_GetWindowSizeX(hWin);
  int ysize = WM_GetWindowSizeY(hWin);
  int FrameSize = pObj->FrameSize;
  GUI_RECT rClient; GUI_GetClientRect(&rClient);
  GUI_SetFont(pObj->pFont);
/* Draw Title */
  GUI_SetBkColor((pObj->Widget.State & WIDGET_STATE_CHILD_HAS_FOCUS) ? pObj->BarColor[1] : pObj->BarColor[0]);
  GUI_SetColor  (pObj->TextColor);
  GUI_SetTextAlign(pObj->TextAlign);
	GUI_ClearRect(FrameSize,FrameSize, xsize-1-FrameSize, FrameSize+pObj->rClient.y0-1);
  GUI_DispStringAt( pObj->pText,
                   FrameSize+pObj->XOff,
                   FrameSize+pObj->YOff);
/* Draw Frame */
  GUI_SetColor  (FRAMEWIN_FRAMECOLOR_DEFAULT);  /* pObj->BarColor[1]*/
  GUI_FillRect  (0, 0, xsize-1, FrameSize-1);
	GUI_FillRect  (0, 0, pObj->rClient.x0-1, ysize-1);
	GUI_FillRect  (pObj->rClient.x1+1, 0, xsize-1, ysize-1);
  GUI_FillRect  (0, pObj->rClient.y1+1, xsize-1, ysize-1);
  GUI_FillRect  (0, pObj->TitleHeight+FrameSize,
                    xsize-1, pObj->TitleHeight+2*FrameSize-1);
/* Draw Client area */
  WM_SetUserClipArea(&pObj->rClient);
  /*GUI_SetBkColor(pObj->ClientColor);
  GUI_Clear();*/
  WM_SetUserClipArea(NULL);
/* Draw the 3D effect (if configured) */
  #if FRAMEWIN_USE_3D
    WIDGET_EFFECT_3D_DrawUp();
  #endif
  
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:34,代码来源:framewin.c

示例3: PaintDialog

static void PaintDialog(WM_MESSAGE * pMsg)
{
    WM_HWIN hWin = pMsg->hWin;
    GUI_SetColor(0xe35400);
    GUI_FillRect(0,0,159,2);
    GUI_SetColor(0xff953d);
    GUI_FillRect(0,0,2,239);
    GUI_SetColor(0xff953d);
    GUI_FillRect(0,231,159,239);
    GUI_SetColor(0xe35400);
    GUI_FillRect(151,0,159,239);
}
开发者ID:weimingtom,项目名称:stm32-gui,代码行数:12,代码来源:num_dialog.c

示例4: _OnPaint

/*********************************************************************
*
*       _OnPaint

  This routine draws the color rectangles.
  The widgets are drawn automatically.
*/
static void _OnPaint(void) {
  /* Draw RGB values */
  GUI_SetColor(_aColorSep[0]);
  GUI_FillRect(180, 20, 199, 39);
  GUI_SetColor(_aColorSep[1] << 8);
  GUI_FillRect(180, 50, 199, 69);
  GUI_SetColor(((U32)_aColorSep[2]) << 16);
  GUI_FillRect(180, 80, 199, 99);
  /* Draw resulting color */
  GUI_SetColor(_aColorSep[0] | (((U32)_aColorSep[1]) << 8) | (((U32)_aColorSep[2]) << 16));
  GUI_FillRect(205, 20, 285, 99);
}
开发者ID:qiurenguo2014,项目名称:youjiesun,代码行数:19,代码来源:DIALOG_SliderColor.c

示例5: Display_Logo

/*********************************************************************************************************
** Function name:           Display_Logo	   
** Descriptions:            Display logo	
** input parameters:        none
** output parameters:       none      
** Returned value:          void
** Changed by:              Lius 2014-8-18  
*********************************************************************************************************/
void Display_Logo()
{
	GUI_SetColor(GUI_WHITE);
	GUI_FillRect(0,0,C_GLCD_H_SIZE,C_GLCD_V_SIZE);
	GUI_DrawBitmap(&bmG631Y2,87,54);		
	GPIO_SetValue(2,LCD_BACK_LIGHT);		
}
开发者ID:waitig,项目名称:GasSub_LPC1788,代码行数:15,代码来源:user_main.c

示例6: _GetPixelsPerSecond

/**
  * @brief  Get the number of pixels per second
  * @param  None
  * @retval Pixels per second
  */
static U32 _GetPixelsPerSecond(void) {
  GUI_COLOR Color, BkColor;
  U32 x0, y0, x1, y1, xSize, ySize;
  I32 t, t0;
  U32 Cnt, PixelsPerSecond, PixelCnt;

  /* Find an area which is not obstructed by any windows */
  xSize   = LCD_GetXSize();
  ySize   = LCD_GetYSize();
  Cnt     = 0;
  x0      = 0;
  x1      = xSize - 1;
  y0      = 65;
  y1      = ySize - 60 - 1;
  Color   = GUI_GetColor();
  BkColor = GUI_GetBkColor();
  GUI_SetColor(BkColor);

  /* Repeat fill as often as possible in 100 ms */
  t0 = GUI_GetTime();
  do {
    GUI_FillRect(x0, y0, x1, y1);
    GUI_Exec();
    Cnt++;
    t = GUI_GetTime();
  } while ((t - (t0 + 100)) <= 0);

  /* Compute result */
  t -= t0;
  PixelCnt = (x1 - x0 + 1) * (y1 - y0 + 1) * Cnt;
  PixelsPerSecond = PixelCnt / t * 1000;
  GUI_SetColor(Color);
  return PixelsPerSecond;
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:39,代码来源:benchmark_win.c

示例7: key_s3c

void key_s3c(void)
{
int which_key,i;
while((rPDATG & 0xf0)==0xf0);
which_key=rPDATG&0xf0;
    switch(which_key)
    {
case 0xe0:
   Led_Display(0x1);
   point.y_point-=20;
   if(point.y_point<20)
   point.y_point=200;
   break;
case 0xd0:
   Led_Display(0x2);
   point.x_point-=20;
   if(point.x_point<20)
   point.x_point=200;
   break;
case 0xb0:
   Led_Display(0x4);
   if( map[point.y_map][point.x_map]==0 )
{
change_color();
map[point.y_map][point.x_map]=point.color;
draw_map();

if( if_won(point.y_map,point.x_map,point.color) )
{
GUI_SetTextMode(GUI_DM_TRANS); //设置为透明
GUI_SetFont(&GUI_Font8x16x1x2);
GUI_DispStringAt("win!",250,90);

for(i=0;i<20;i++)
GUI_Delay(1000);
map_initial();

GUI_SetDrawMode(GUI_DM_NORMAL);
GUI_SetColor(GUI_GREEN);
GUI_FillRect(0,0,320,240);
draw_net();
draw_point();
}

}
   break;
case 0x70:
   Led_Display(0x7);
   /*
   point.x_point+=20;
   if(point.x_point>200)
   point.x_point-=20;*/
   break;
default :
   break;
    }
    
    
}
开发者ID:yuekeshuang,项目名称:akaedu-c-learning,代码行数:59,代码来源:k.c

示例8: USER_LCD_LOG_SetTestArea

/**
  * @brief  Display the application header on the USER_LCD screen 
  * @param  header: pointer to the string to be displayed
  * @retval None
  */
void USER_LCD_LOG_SetTestArea (uint16_t x0,uint16_t y0,uint16_t xSize,uint16_t ySize)
{
  GUI_SetFont(&USER_LCD_LOG_TEXT_FONT);
  GUI_SetColor(USER_LCD_LOG_BACKGROUND_COLOR);
  GUI_FillRect(x0, y0-GUI_GetFontSizeY(), x0+xSize, y0+ySize);
  GUI_SetColor(USER_LCD_LOG_BACKGROUND_COLOR_EX);
  GUI_DrawRect(x0, y0-GUI_GetFontSizeY(), x0+xSize, y0+ySize);
}
开发者ID:datle2805,项目名称:Smart-Home-UI,代码行数:13,代码来源:userlog.c

示例9: GUI_SetColor

void CheckBoxMenu::clearInner()
{
	GUI_SetColor(MENU_TEXT_BK_NORMAL_COLOR);
	GUI_FillRect(x0+CheckBox_A_margin+CheckBox_A_padding,
			y0+CheckBox_A_margin+CheckBox_A_padding,
			x0+CheckBox_A_margin+CheckBox_A_padding+getAS(),
			y0+CheckBox_A_margin+CheckBox_A_padding+getAS());
}
开发者ID:2cats,项目名称:STM32,代码行数:8,代码来源:CheckBoxMenu.cpp

示例10: _AnimFillRect

/*********************************************************************
*
*       _AnimFillRect
*/
static void _AnimFillRect(GUI_ANIM_INFO * pInfo, void * pVoid) {
  ANIM_DATA * pData;
  static int xPosOld;

  _PrepareDrawing(pInfo, pVoid, &pData, xPosOld, 3);
  GUI_FillRect(pData->xPos - pData->ObjectSize, pData->yPos - pData->ObjectSize, pData->xPos + pData->ObjectSize, pData->yPos + pData->ObjectSize);
  xPosOld = pData->xPos;
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:12,代码来源:ANIMATION_Basics.c

示例11: _OnPaint

/*********************************************************************
*
*       _OnPaint
*/
static void _OnPaint(void) {
  int xPos = 0;
  GUI_RECT Rect;
  GUI_SetBkColor(GUI_GRAY);
  GUI_Clear();
  WM_GetClientRect(&Rect);
  Rect.x1 = HEADER_GetItemWidth(_hHeader, 0);
  GUI_SetColor(GUI_RED);
  GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
  Rect.x0 = Rect.x1;
  Rect.x1 += HEADER_GetItemWidth(_hHeader, 1);
  GUI_SetColor(GUI_GREEN);
  GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
  Rect.x0 = Rect.x1;
  Rect.x1 += HEADER_GetItemWidth(_hHeader, 2);
  GUI_SetColor(GUI_BLUE);
  GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
}
开发者ID:huangfeng007,项目名称:ChuangKeUnion-1st,代码行数:22,代码来源:WIDGET_Header.c

示例12: GUI_SetColor

void Rectangle::fill(int arg)
{
	if(GUI_COLOR_NONE!=arg)
	{
		GUI_SetColor(arg);
		GUI_FillRect(x0, y0, x1, y1);
	}

}
开发者ID:2cats,项目名称:STM32,代码行数:9,代码来源:Rectangle.cpp

示例13: Run_SpeedTest

/**
  * @brief  Run speed test
  * @param  None
  * @retval Pixels per second
  */
static int Run_SpeedTest(void) {
  int      TimeStart, i;
  U32      PixelsPerSecond;
  unsigned aColorIndex[8];
  int      xSize, ySize, vySize;
  GUI_RECT Rect, ClipRect;
  xSize  = LCD_GetXSize();
  ySize  = LCD_GetYSize();
  vySize = LCD_GetVYSize();
#if GUI_SUPPORT_CURSOR
  GUI_CURSOR_Hide();
#endif
  if (vySize > ySize) {
    ClipRect.x0 = 0;
    ClipRect.y0 = 0;
    ClipRect.x1 = xSize;
    ClipRect.y1 = ySize;
    GUI_SetClipRect(&ClipRect);
  }

  Stop_Test = 0;

  for (i = 0; i< 8; i++) {
    aColorIndex[i] = GUI_Color2Index(_aColor[i]);
  }
  TimeStart = GUI_GetTime();
  for (i = 0; ((GUI_GetTime() - TimeStart) < 5000) &&( Stop_Test == 0); i++) {
    GUI_SetColorIndex(aColorIndex[i&7]);

    /* Calculate random positions */
    Rect.x0 = rand() % xSize - xSize / 2;
    Rect.y0 = rand() % ySize - ySize / 2;
    Rect.x1 = Rect.x0 + 20 + rand() % xSize;
    Rect.y1 = Rect.y0 + 20 + rand() % ySize;
    GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);

    /* Clip rectangle to visible area and add the number of pixels (for speed computation) */
    if (Rect.x1 >= xSize) {
      Rect.x1 = xSize - 1;
    }
    if (Rect.y1 >= ySize) {
      Rect.y1 = ySize - 1;
    }
    if (Rect.x0 < 0 ) {
      Rect.x0 = 0;
    }
    if (Rect.y1 < 0) {
      Rect.y1 = 0;
    }
    GUI_Exec();
    /* Allow short breaks so we do not use all available CPU time ... */
  }
  PixelsPerSecond = _GetPixelsPerSecond();
  GUI_SetClipRect(NULL);
  return PixelsPerSecond;
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:61,代码来源:benchmark_win.c

示例14: display_all

//@@@@@@@@@@@@@@@@@@@@  覆盖背景,重画方格 @@@@@@@@@@@@@@@@@@@@@@
void display_all(void)
{
GUI_SetColor(GUI_GREEN);
GUI_FillRect(0,0,320,240);

draw_net();
draw_map();
draw_point();

}
开发者ID:yuekeshuang,项目名称:akaedu-c-learning,代码行数:11,代码来源:k.c

示例15: _DrawDiagramAt

/*********************************************************************
*
*       _DrawDiagramAt
*/
static void _DrawDiagramAt(GUI_MEMDEV_Handle hMem, int xPos, int yPos, int * py, int xBlend) {
  GUI_MEMDEV_Handle hMemOld;
  GUI_RECT          Rect;
  int               IndexBmBar;
  int               ySizeBar;
  int               i;

  hMemOld = GUI_MEMDEV_Select(hMem);
  //
  // Draw blue background
  //
  GUI_SetColor(0x4a2210);
  GUI_FillRoundedRect(xPos, yPos, xPos + GRAPH_WIDTH, yPos + GRAPH_HEIGHT, 4);
  //
  // Draw grid lines
  //
  GUI_SetColor(0x774830);
  for (i = 0; i < 12; i++) {
    GUI_DrawHLine(yPos + 6 + i * 10, xPos + 2, xPos + GRAPH_WIDTH - 2);
  }
  //
  // Draw bars
  //
  for (i = 0; i < 10; i++) {
    IndexBmBar = (i < 6) ? i / 2 : 4 - (i / 2);
    ySizeBar = *(py + i);
    GUI_DrawBitmapMag(_apBmBar[IndexBmBar], xPos + 8 + i * 16, yPos + GRAPH_HEIGHT - ySizeBar - 6, 1, ySizeBar);
  }
  //
  // Draw alpha effect
  //
  Rect.x0 = xPos;
  Rect.x1 = xPos + 3;
  Rect.y0 = yPos;
  Rect.y1 = yPos + GRAPH_HEIGHT;
  GUI_SetClipRect(&Rect);
  GUI_SetColor(0xd99100);
  GUI_SetAlpha(168);
  GUI_FillRoundedRect(xPos, yPos, xPos + GRAPH_WIDTH, yPos + GRAPH_HEIGHT, 4);
  GUI_SetClipRect(NULL);
  GUI_FillRect(xPos + 4, yPos + 1, xPos + xBlend, yPos + GRAPH_HEIGHT - 1);
  GUI_SetAlpha(0);
  //
  // Draw orange frame
  //
  GUI_SetColor(0x0094f3);
  GUI_DrawRoundedRect(xPos, yPos, xPos + GRAPH_WIDTH, yPos + GRAPH_HEIGHT, 4);
  //
  // Label
  //
  _DrawLabel(hMem, xPos, yPos);
  GUI_MEMDEV_CopyToLCD(hMem);
  GUI_MEMDEV_Select(hMemOld);
}
开发者ID:glorycoder,项目名称:asm9260t,代码行数:58,代码来源:GUIDEMO_BarGraph.c


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