本文整理汇总了C++中GUI_FillRect函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_FillRect函数的具体用法?C++ GUI_FillRect怎么用?C++ GUI_FillRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_FillRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: DisplayBattery
void DisplayBattery(void)
{
u16 ADC1_value;
u32 temp_color;
ADC1_value = ADC_GetConversionValue(ADC1);
GUI_SetFont(&GUI_Font6x8);
GUI_SetColor(GUI_WHITE);
GUI_DispStringAt("RFID",3,0);
temp_color=GUI_GetColor();
GUI_SetColor(GUI_GREEN);
if (ADC1_value > 2500)
{
GUI_DrawPixel(80,3);
GUI_DrawPixel(80,4);
GUI_FillRect (81,0,95,7);
}
else if (ADC1_value > 2350)
{
GUI_DrawPixel(80,3);
GUI_DrawPixel(80,4);
GUI_FillRect (81,0,95,7);
GUI_ClearRect(82,1,86,6);
}
else if(ADC1_value > 2300)
{
GUI_DrawPixel(80,3);
GUI_DrawPixel(80,4);
GUI_FillRect (81,0,95,7);
GUI_ClearRect(82,1,90,6);
}
else
{
GUI_SetColor(GUI_RED);
GUI_DrawPixel(80,3);
GUI_DrawPixel(80,4);
GUI_FillRect (81,0,95,7);
GUI_ClearRect(82,1,94,6);
}
GUI_SetColor(temp_color);
GUI_SetFont(&GUI_NOW_FONT);
}
开发者ID:gaodebang,项目名称:stm32f103-eval,代码行数:41,代码来源:display.c
示例17: _cbStatus
/**
* @brief Callback routine of the status bar
* @param pMsg: pointer to a data structure of type WM_MESSAGE
* @retval None
*/
static void _cbStatus(WM_MESSAGE* pMsg) {
int xSize, ySize;
static uint8_t TempStr[50];
static WM_HTIMER hTimerTime;
WM_HWIN hWin;
hWin = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_CREATE:
hTimerTime = WM_CreateTimer(hWin, ID_TIMER_TIME, 1000, 0);
break;
case WM_DELETE:
WM_DeleteTimer(hTimerTime);
break;
case WM_TIMER:
WM_InvalidateWindow(hWin);
WM_RestartTimer(pMsg->Data.v, 0);
break;
case WM_PAINT:
xSize = WM_GetWindowSizeX(hWin);
ySize = WM_GetWindowSizeY(hWin);
/* Draw background */
GUI_SetColor(0x303030);
GUI_FillRect(0, 0, xSize, ySize - 3);
GUI_SetColor(0x808080);
GUI_DrawHLine(ySize - 2, 0, xSize);
GUI_SetColor(0x404040);
GUI_DrawHLine(ySize - 1, 0, xSize);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetColor(GUI_WHITE);
GUI_SetFont(GUI_FONT_13B_ASCII);
/* Serial port*/
if (pdTRUE == BluetoothReady) {
GUI_DrawBitmap(&bmICON_BluetoothStatus, xSize - 155, 0);
}
if (pdTRUE == GPSReady) {
GUI_DrawBitmap(&bmICON_GPS_Status, xSize - 125, 0);
}
sprintf((char *)TempStr, "CPU : %d %%", FreeRTOS_GetCPUUsage());
if (75 > FreeRTOS_GetCPUUsage()) {
GUI_SetColor(GUI_WHITE);
}
else {
GUI_SetColor(GUI_RED);
}
GUI_DispStringAt((char *)TempStr, 4, 4);
GUI_SetColor(GUI_WHITE);
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
开发者ID:LucianZala,项目名称:SmartEmbeddedDeviceFW,代码行数:58,代码来源:menu.c
示例18: _DrawIt
/*******************************************************************
*
* _DrawIt
*/
static void _DrawIt(void * pData) {
tDrawItContext * pDrawItContext = (tDrawItContext *)pData;
GUI_Clear();
GUI_SetFont(&GUI_Font8x8);
GUI_SetTextMode(GUI_TM_TRANS);
/* draw background */
GUI_SetColor(GUI_GREEN);
GUI_FillRect(pDrawItContext->XPos_Text,
pDrawItContext->YPos_Text - 25,
pDrawItContext->XPos_Text + 100,
pDrawItContext->YPos_Text - 5);
/* draw polygon */
GUI_SetColor(GUI_BLUE);
GUI_FillPolygon(pDrawItContext->aPointsDest, SIZE_OF_ARRAY(aPoints), 160, 120);
/* draw foreground */
GUI_SetColor(GUI_RED);
GUI_FillRect(220 - pDrawItContext->XPos_Text,
pDrawItContext->YPos_Text + 5,
220 - pDrawItContext->XPos_Text + 100,
pDrawItContext->YPos_Text + 25);
}
开发者ID:dadianxukong,项目名称:gps,代码行数:25,代码来源:MEMDEV_Banding.c
示例19: vCardDisplay
void vCardDisplay( void )
{
char fullname[64];
if( empty == 2 )
return;
WM_SetDesktopColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_SetBkColor(GUI_WHITE);
GUI_Clear();
GUI_GIF_Draw((const void *)aclogo_silica_11022010, sizeof(aclogo_silica_11022010), 100, 0);
strcpy( fullname, data->nameFirstname );
strcat( fullname, " " );
strcat( fullname, data->nameLastname );
GUI_SetFont(&GUI_Font24B_ASCII);
GUI_DispStringAt( fullname, 20, 70);
GUI_SetFont(&GUI_Font16B_ASCII);
GUI_DispStringAt( data->CompName, 20, X_firm);
GUI_SetFont(&GUI_Font13_ASCII);
GUI_DispStringAt( data->CompStreet, 20, X_firm+16);
GUI_DispStringAt( data->CompCity, 20, X_firm+16+13);
strcpy( fullname, data->CompZip );
strcat( fullname, " " );
strcat( fullname, data->CompState );
strcat( fullname, " " );
strcat( fullname, data->CompCountry );
GUI_DispStringAt( fullname, 20, X_firm+16+13+13);
strcpy( fullname, "TEL : " );
strcat( fullname, data->CompPhone );
GUI_DispStringAt( fullname, 20, X_tel);
strcpy( fullname, "FAX : " );
strcat( fullname, data->CompFax );
GUI_DispStringAt( fullname, 20, X_tel+13);
strcpy( fullname, "CELL : " );
strcat( fullname, data->ContactCellPho );
GUI_DispStringAt( fullname, 20, X_tel+13+13);
GUI_SetColor( (GUI_COLOR)0x007f7f7f );
GUI_FillRect( 0, 214, 319, 239 );
GUI_SetBkColor((GUI_COLOR)0x007f7f7f);
GUI_SetColor(GUI_RED);
GUI_SetFont(&GUI_Font16B_ASCII);
GUI_DispStringAt( "The Engineering of Distribution.", 20, 220);
empty = 2;
}
开发者ID:lollofranziPoliMi,项目名称:med-nager,代码行数:52,代码来源:mainGUI.c
示例20: GUIDEMO_Speed
void GUIDEMO_Speed(void) {
int t = GUI_GetTime();
int i = 0;
int XSize = LCD_GET_XSIZE();
int YSize = LCD_GET_YSIZE();
I32 NumPixels=0;
U16 aColorIndex[8];
GUIDEMO_ShowIntro("High speed",
"Multi layer clipping"
"\nHighly optimized drivers"
);
for (i = 0; i< 8; i++) {
aColorIndex[i] = GUI_Color2Index(_aColor[i]);
}
for (i = 0; (((t + 8000) - (int)GUI_GetTime()) > 0) && !GUIDEMO_CheckCancel(); i++) {
GUI_RECT r;
GUI_SetColorIndex(aColorIndex[i&7]);
/* Calculate random positions */
r.x0 = rand() % XSize - XSize / 2;
r.y0 = rand() % YSize - YSize / 2;
r.x1 = r.x0 + rand() % XSize;
r.y1 = r.y0 + rand() % YSize;
GUI_FillRect(r.x0, r.y0, r.x1, r.y1);
/* Clip rectangle to visible area and add the number of pixels (for speed computation) */
if (r.x1 >= XSize)
r.x1 = XSize - 1;
if (r.y1 >= YSize)
r.y1 = YSize - 1;
if (r.x0 < 0 )
r.x0 = 0;
if (r.y1 < 0)
r.y1 = 0;
NumPixels += (r.x1 - r.x0) * (r.y1 - r.y0);
/* Allow short breaks so we do not use all available CPU time ... */
}
t = (GUI_GetTime() - t) / 100;
GUI_Clear();
GUIDEMO_NotifyStartNext();
#if GUIDEMO_LARGE
GUI_SetFont(&GUI_FontComic24B_ASCII);
#else
GUI_SetFont(&GUI_Font16B_ASCII);
#endif
GUI_SetColor(GUI_WHITE);
GUI_DispStringAt("Pixels/sec: ", 10, (LCD_GetYSize() - GUI_GetFontSizeY()) / 2);
if (t == 0)
t++;
GUI_DispDecMin(10 * (NumPixels / t));
GUIDEMO_Wait();
}
开发者ID:DlutLiuZhao,项目名称:UCGUI,代码行数:50,代码来源:GUIDEMO_Speed.c
注:本文中的GUI_FillRect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论