您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GrStringDraw函数代码示例

51自学网 2021-06-01 21:19:27
  C++
这篇教程C++ GrStringDraw函数代码示例写得很实用,希望能帮到您。

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

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

示例1: PrintReminder

void PrintReminder(tContext *context, y_menus f_menuChoice){	char outString[32] = "";	unsigned char text_start = 18;	// Draw top and bottom banner and buttons	LoadLeftButton( context , "BACK");	LoadMiddleButton( context , "SEL");	//LoadRightButton("");	// Menu options	GrStringDraw( context, "Create Reminder", AUTO_STRING_LENGTH, 5, 18, OPAQUE_TEXT);	GrStringDraw( context, "Remove Reminder", AUTO_STRING_LENGTH, 5, 31, OPAQUE_TEXT);	// Highlight selected item	switch (f_menuChoice) {	case Reminder_Create:		text_start = 18;		strcpy(outString, "Create Reminder");		break;	case Reminder_Remove:		text_start = 31;		strcpy(outString, "Remove Reminder");		break;	default: break;	}	GrContextForegroundSet(context, ClrWhite); //ClrBlack       this affects the highlight color	GrContextBackgroundSet(context, ClrBlack);    //ClrWhite      this affects the text color in the highlight	GrStringDraw(context, outString, AUTO_STRING_LENGTH, 5, text_start, OPAQUE_TEXT);	GrContextForegroundSet(context, ClrBlack);	GrContextBackgroundSet(context, ClrWhite);}
开发者ID:GevenM,项目名称:giip,代码行数:35,


示例2: window_drawtime

void window_drawtime(tContext *pContext, long y, uint8_t times[3], uint8_t selected){  char data[3];  data[0] = data[1] = '0';  data[2] = ':';  #define SPACING 3  uint8_t height = GrStringHeightGet(pContext);    uint8_t width_all = GrStringWidthGet(pContext, data, 3) + 10;  uint8_t width_digit = GrStringWidthGet(pContext, data, 2) + 4;  long startx = (LCD_WIDTH - width_all - width_all - width_digit) / 2;  if (startx < 0) startx = 0;  for(int i = 0; i < 3; i++)  {    data[0] = '0' + times[i] / 10;    data[1] = '0' + times[i] % 10;    GrContextForegroundSet(pContext, ClrWhite);    GrContextBackgroundSet(pContext, ClrBlack);    if (selected & (1 << i))      window_selecttext(pContext, data, 2, startx + SPACING + i * width_all, y);    else      GrStringDraw(pContext, data, 2, startx + SPACING + i * width_all, y, 0);    if (i != 2)    {      GrContextForegroundSet(pContext, ClrWhite);      GrContextBackgroundSet(pContext, ClrBlack);      GrStringDraw(pContext, ":", 1, startx + SPACING + width_digit + i * width_all, y, 0);    }  }}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:35,


示例3: DisplayIntStatus

//*****************************************************************************//// Display the interrupt state on the CSTN.  The currently active and pending// interrupts are displayed.////*****************************************************************************voidDisplayIntStatus(void){    uint32_t ui32Temp;    char pcBuffer[6];    //    // Display the currently active interrupts.    //    ui32Temp = HWREG(NVIC_ACTIVE0);    pcBuffer[0] = ' ';    pcBuffer[1] = (ui32Temp & 1) ? '1' : ' ';    pcBuffer[2] = (ui32Temp & 2) ? '2' : ' ';    pcBuffer[3] = (ui32Temp & 4) ? '3' : ' ';    pcBuffer[4] = ' ';    pcBuffer[5] = '/0';    GrStringDraw(&g_sContext, pcBuffer, -1, 48, 32, 1);    //    // Display the currently pending interrupts.    //    ui32Temp = HWREG(NVIC_PEND0);    pcBuffer[1] = (ui32Temp & 1) ? '1' : ' ';    pcBuffer[2] = (ui32Temp & 2) ? '2' : ' ';    pcBuffer[3] = (ui32Temp & 4) ? '3' : ' ';    GrStringDraw(&g_sContext, pcBuffer, -1, 48, 44, 1);    //    // Flush the display.    //    GrFlush(&g_sContext);}
开发者ID:PhamVanNhi,项目名称:ECE5770,代码行数:38,


示例4: drawGridTime

static void drawGridTime(tContext *pContext){  char buf[20];  uint8_t time[3];  time[0] = workout_time % 60;  time[1] = (workout_time / 60 ) % 60;  time[2] = workout_time / 3600;  GrContextForegroundSet(pContext, ClrBlack);  switch(window_readconfig()->sports_grid)  {  case GRID_3:    GrContextFontSet(pContext, (tFont*)&g_sFontExIcon16);    GrStringDraw(pContext, "i", 1, 10, 15, 0);    GrContextFontSet(pContext, &g_sFontGothic18);    GrStringDraw(pContext, datapoints[0].name, -1, 28, 15, 0);    GrContextFontSet(pContext, &g_sFontGothic28b);    sprintf(buf, "%02d:%02d:%02d", time[2], time[1], time[0]);    GrStringDrawCentered(pContext, buf, -1, LCD_WIDTH/2, 50, 0);    break;  case GRID_4:  case GRID_5:    GrContextFontSet(pContext, &g_sFontGothic28b);    sprintf(buf, "%02d:%02d:%02d", time[2], time[1], time[0]);    GrStringDrawCentered(pContext, buf, -1, LCD_WIDTH/2, 18, 0);    break;  }}
开发者ID:Echoskope,项目名称:KreyosFirmware,代码行数:28,


示例5: UpdateWindow

//*****************************************************************************//// This function updates the contents of the directory text window.//// /param None.//// This function is will update the state of the directory window.  This can// be the result of a DirUpdate() call which completely changed the contents// of the window, or a selection changed and the screen needs to be updated.//// /return None.////*****************************************************************************voidUpdateWindow(void){    int iIdx;    int iLine;    //    // Set the first line of the directory text window.    //    iLine = TOP_HEIGHT;    //    // Clear out the text area for the entries.    //    ClearTextBox();    //    // Display all valid values.    //    for(iIdx = 0; iIdx < g_DirData.ulValidValues; iIdx++)    {        //        // Change the backgound for the selected item.        //        if(g_DirData.ulSelectIndex == iIdx)        {            GrContextBackgroundSet(&g_sContext, ClrGray);        }        else        {            GrContextBackgroundSet(&g_sContext, ClrBlack);        }        //        // Change the color for directories.        //        if (g_DirData.FileInfo[iIdx].fattrib & AM_DIR)        {            GrContextForegroundSet(&g_sContext, DIR_COLOR);            GrStringDraw(&g_sContext, g_DirData.FileInfo[iIdx].fname,                         100, 0, iLine, 1);        }        //        // Change the color for files.        //        else        {            GrContextForegroundSet(&g_sContext, FILE_COLOR);            GrStringDraw(&g_sContext, g_DirData.FileInfo[iIdx].fname,                         100, 0, iLine, 1);        }        //        // Move down by the height of the characters used.        //        iLine += g_sFontFixed6x8.ucHeight;    }}
开发者ID:fejerson108,项目名称:Stellarisware,代码行数:71,


示例6: test_motor

uint8_t test_motor(uint8_t ev, uint16_t lparam, void* rparam){	switch(ev)	{		case EVENT_WINDOW_CREATED:		data = 0;		break;		case EVENT_KEY_PRESSED:		{			switch(lparam)			{				case KEY_UP:				data++;				if (data > 16) data = 1;				break;				case KEY_DOWN:				data--;				if (data == 0) data = 16;				break;				case KEY_ENTER:				data = 0;				break;			}			motor_on(data, 0);			window_invalid(NULL);			break;		}		case EVENT_WINDOW_PAINT:		{		  char buf[32];		  tContext *pContext = (tContext*)rparam;		  GrContextForegroundSet(pContext, ClrBlack);		  GrRectFill(pContext, &client_clip);		  GrContextForegroundSet(pContext, ClrWhite);  	      GrContextFontSet(pContext, (tFont*)&g_sFontGothic18); 		  GrStringDraw(pContext, "Test Motor", -1, 32, 50, 0);    	  sprintf(buf, "Motor Level: %d", data); 		  GrStringDraw(pContext, buf, -1, 5, 70, 0); 		  window_button(pContext, KEY_UP, "+"); 		  window_button(pContext, KEY_DOWN, "-"); 		  window_button(pContext, KEY_ENTER, "Reset"); 		  break; 		}		case EVENT_EXIT_PRESSED:		motor_on(0, 0);		return 0; // return 0 to close the window		default:		return 0;	}	return 1;}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:57,


示例7: ScrollText

//*****************************************************************************//// Handles scrolling the text on the screen.////*****************************************************************************static voidScrollText(void){    int32_t i32Idx;    uint32_t ui32Line, ui32Start;    ui32Line = 0;    //    // Skip the oldest entry in the circular list.    //    if(g_ui32CurrentLine == (MAX_LINES - 1)) {        //        // If at the end of the list wrap to entry 1.        //        ui32Start = 1;    } else {        //        // The oldest is 1 in front of the most recent.        //        ui32Start = g_ui32CurrentLine + 2;    }    //    // Print lines from the current position down first.    //    for(i32Idx = ui32Start; i32Idx < MAX_LINES; i32Idx++) {        GrStringDraw(&g_sContext, g_ppcLines[i32Idx],                     strlen(g_ppcLines[i32Idx]), DISPLAY_TEXT_BORDER_H,                     DISPLAY_BANNER_HEIGHT + DISPLAY_TEXT_BORDER +                     (ui32Line * GrFontHeightGet(g_psFontFixed6x8)), 1);        ui32Line++;    }    //    // If not the special case of the last line where everything has already    // printed, print the remaining lines.    //    if(g_ui32CurrentLine != (MAX_LINES - 1)) {        for(i32Idx = 0; i32Idx <= g_ui32CurrentLine; i32Idx++) {            GrStringDraw(&g_sContext, g_ppcLines[i32Idx],                         strlen(g_ppcLines[i32Idx]),                         DISPLAY_TEXT_BORDER_H,                         DISPLAY_BANNER_HEIGHT + DISPLAY_TEXT_BORDER +                         (ui32Line * GrFontHeightGet(g_psFontFixed6x8)), 1);            ui32Line++;        }    }    //    // Reset the column to zero.    //    g_ui32Column = 0;}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:61,


示例8: MainLoopRun

//*****************************************************************************//// The main loop of the application.  This implementation is specific to the// EK-LM4F232 board and merely displays the current timer count value and the// number of interrupts taken.  It contains nothing directly relevant to the// timer configuration or operation.////*****************************************************************************voidMainLoopRun(void){    uint32_t ui32Count, ui32LastCount;    //    // Set up for the main loop.    //    ui32LastCount = 10;    //    // Loop forever while the timer runs.    //    while(1)    {        //        // Get the current timer count.        //        ui32Count = ROM_TimerValueGet(TIMER4_BASE, TIMER_A);        //        // Has it changed?        //        if(ui32Count != ui32LastCount)        {            //            // Yes - update the display.            //            usnprintf(g_pcPrintBuff, PRINT_BUFF_SIZE, "%d ", ui32Count);            GrStringDraw(&g_sContext, g_pcPrintBuff, -1, 80, 26, true);            //            // Remember the new count value.            //            ui32LastCount = ui32Count;        }        //        // Has there been an interrupt since last we checked?        //        if(HWREGBITW(&g_ui32Flags, 0))        {            //            // Clear the bit.            //            HWREGBITW(&g_ui32Flags, 0) = 0;            //            // Update the interrupt count.            //            usnprintf(g_pcPrintBuff, PRINT_BUFF_SIZE, "%d ", g_ui32IntCount);            GrStringDraw(&g_sContext, g_pcPrintBuff, -1, 80, 36, true);        }    }}
开发者ID:PhamVanNhi,项目名称:ECE5770,代码行数:63,


示例9: OnIntroPaint

//*****************************************************************************//// Handles paint requests for the introduction canvas widget.////*****************************************************************************voidOnIntroPaint(tWidget *psWidget, tContext *psContext){    //    // Display the introduction text in the canvas.    //    GrContextFontSet(psContext, g_psFontCm16);    GrContextForegroundSet(psContext, ClrSilver);    GrStringDraw(psContext, "This application demonstrates the ", -1,                 10, 30, 0);    GrStringDraw(psContext, "TivaWare Graphics Library.", -1,                  10, (30+16), 0);    GrStringDraw(psContext, "Each panel shows a different feature of", -1,                  10, (30+(16*2)), 0);    GrStringDraw(psContext, "the graphics library. Widgets on the panels", -1,                  10, (30+(16*3)), 0);    GrStringDraw(psContext, "are fully operational; pressing them will", -1,                  10, (30+(16*4)), 0);    GrStringDraw(psContext, "result in visible feedback of some kind.", -1,                  10, (30+(16*5)), 0);    GrStringDraw(psContext, "Press the + and - buttons at the bottom", -1,                  10, (30+(16*6)), 0);    GrStringDraw(psContext, "of the screen to move between the panels.", -1,                  10, (30+(16*7)), 0);}
开发者ID:bli19,项目名称:unesp_mdt,代码行数:30,


示例10: main

int main(void){   SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);   Kentec320x240x16_SSD2119Init();   GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);   ClrScreen();   GrImageDraw(&sContext, g_pui8Image, 0, 0);   GrFlush(&sContext);   SysCtlDelay(SysCtlClockGet());   // Later lab steps go between here   ClrScreen();   sRect.i16XMin = 1;   sRect.i16YMin = 1;   sRect.i16XMax = 318;   sRect.i16YMax = 238;   GrContextForegroundSet(&sContext, ClrRed);   GrContextFontSet(&sContext, &g_sFontCmss30b);   GrStringDraw(&sContext, "Texas", -1, 110, 2, 0);   GrStringDraw(&sContext, "Instruments", -1, 80, 32, 0);   GrStringDraw(&sContext, "Graphics", -1, 100, 62, 0);   GrStringDraw(&sContext, "Lab", -1, 135, 92, 0);   GrContextForegroundSet(&sContext, ClrWhite);   GrRectDraw(&sContext, &sRect);   GrFlush(&sContext);   SysCtlDelay(SysCtlClockGet());   GrContextForegroundSet(&sContext, ClrYellow);   GrCircleFill(&sContext, 80, 182, 50);   sRect.i16XMin = 160;   sRect.i16YMin = 132;   sRect.i16XMax = 312;   sRect.i16YMax = 232;   GrContextForegroundSet(&sContext, ClrGreen);   GrRectDraw(&sContext, &sRect);   SysCtlDelay(SysCtlClockGet());   // and here   ClrScreen();   while(1)   {   }}
开发者ID:eXamadeus,项目名称:SR03-Robot,代码行数:50,


示例11: drawItem

static void drawItem(tContext *pContext, uint8_t n, char icon, const char* text, const char* value){  if (icon)    {      GrContextFontSet(pContext, (tFont*)&g_sFontExIcon16);      GrStringDraw(pContext, &icon, 1, 3, 12 + n * LINEMARGIN, 0);    }  // draw text  GrContextFontSet(pContext, &g_sFontGothic24b);  GrStringDraw(pContext, text, -1, 20, 10 + n * LINEMARGIN, 0);  uint8_t width = GrStringWidthGet(pContext, value, -1);  GrStringDraw(pContext, value, -1, LCD_WIDTH - width - 4, 10 + n * LINEMARGIN, 0);}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:15,


示例12: OnFirmwarePaint

//*****************************************************************************//// Handles paint requests for the firmware update canvas widget.////*****************************************************************************voidOnFirmwarePaint(tWidget *pWidget, tContext *pContext){    unsigned long ulLines;    long lLineHeight, lOffset;    lLineHeight = GrFontHeightGet(FONT_14PT);    lOffset = 32;    //    // Display the firmware update instruction text in the canvas.    //    GrContextFontSet(pContext, FONT_14PT);    GrContextForegroundSet(pContext, ClrSilver);    GrStringGet(STR_UPDATE_TEXT, g_pcBuffer, SCOMP_MAX_STRLEN);    ulLines = DrawStringWrapped(pContext, g_pcBuffer, lLineHeight, 1, lOffset,                                g_pLanguageTable[g_ulLangIdx].bBreakOnSpace );    //    // Move down by 1/4 of a line.    //    lOffset += lLineHeight/4;    //    // Format the UART setting information string    //    GrStringGet(STR_UART, g_pcBuffer, SCOMP_MAX_STRLEN);    GrStringDraw(pContext, g_pcBuffer, -1, 1,                 lOffset + (ulLines * lLineHeight), 0);}
开发者ID:yangjunjiao,项目名称:Luminary-Micro-Library,代码行数:36,


示例13: devpkLcdText

/******************************************************************************* * @fn          devpkLcdText * * @brief       Write a text string to a specific line/column of the display * * @param       str - text to apply * @param       line - line index (0 .. 11) * @param       col - column index (0 .. 15) * * @return      true if success */bool devpkLcdText(const char *str, uint8_t line, uint8_t col){  if (hLcdPin != NULL)  {    uint8_t xp, yp;    Semaphore_pend(hSemLCD, BIOS_WAIT_FOREVER);    xp = col * CHAR_WIDTH + 1;    yp = line * CHAR_HEIGHT + 0;    // Draw a text on the display    GrStringDraw(&g_sContext,                 str,                 AUTO_STRING_LENGTH,                 xp,                 yp,                 OPAQUE_TEXT);    GrFlush(&g_sContext);    Semaphore_post(hSemLCD);  }  return hLcdPin != NULL;}
开发者ID:ClarePhang,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:37,


示例14: output

void output(int n,int (*drawArray)[10]){	static char pcCanvasText[5];	int i,j,color;	for ( i = 0; i < 4; ++i){		for ( j = 0; j < 4; ++j){			sRect.i16XMin = 64+i*48 +1;//16			sRect.i16YMin = 24+j*48 +1;//64			sRect.i16XMax = 112+i*48 -1;			sRect.i16YMax = 72+j*48 -1;			color = drawArray[i][j]%5;			GrContextForegroundSet(&context, DrawColor[color]);			GrRectFill(&context, &sRect);			usprintf(pcCanvasText, "%3d", drawArray[i][j]);			GrContextForegroundSet(&context, ClrBlack);		    GrContextFontSet(&context, &g_sFontCm20);		    GrStringDraw(&context, pcCanvasText, -1, 64+i*48 +1, 24+j*48 +16, 0);		}	}}
开发者ID:jay88159,项目名称:ColorRun_Game,代码行数:27,


示例15: lcdPutChar

void lcdPutChar(char_t c){   if(c == '/r')   {      lcdColumn = 0;   }   else if(c == '/n')   {      lcdColumn = 0;      lcdLine++;   }   else if(lcdLine < 26 && lcdColumn < 40)   {      char_t buffer[2];      buffer[0] = c;      buffer[1] = '/0';      //Display current character      GrStringDraw(&grContext, buffer, 1, lcdColumn * 6, lcdLine * 12, TRUE);      //Advance the cursor position      if(++lcdColumn >= 40)      {         lcdColumn = 0;         lcdLine++;      }   }}
开发者ID:nandojve,项目名称:embedded,代码行数:28,


示例16: OnFirmwarePaint

//*****************************************************************************//// Handles paint requests for the firmware update canvas widget.////*****************************************************************************voidOnFirmwarePaint(tWidget *pWidget, tContext *pContext){    //    // Display the firmware update instruction text in the canvas.    //    GrContextFontSet(pContext, g_pFontCm18);    GrContextForegroundSet(pContext, ClrSilver);    GrStringDraw(pContext, "You may replace the software image", -1, 10, 32, 0);    GrStringDraw(pContext, "flashed by pressing the /"Update/" button", -1, 10,                 50, 0);    GrStringDraw(pContext, "then using the LMFlash utility to send", -1, 10,                 68, 0);    GrStringDraw(pContext, "a new image via the serial interface.", -1, 10, 86,                 0);}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:21,


示例17: test_dut

uint8_t test_dut(uint8_t ev, uint16_t lparam, void* rparam){	//uint8_t buf[sizeof(HCI_VS_DRPb_Tester_Packet_TX_RX_Cmd)];	switch(ev)	{		case EVENT_WINDOW_CREATED:			//bluetooth_enableDUTMode();		break;		case EVENT_WINDOW_PAINT:		{		  tContext *pContext = (tContext*)rparam;		  GrContextForegroundSet(pContext, ClrBlack);		  GrRectFill(pContext, &client_clip);		  GrContextForegroundSet(pContext, ClrWhite);      GrContextFontSet(pContext, (tFont*)&g_sFontGothic18);      	  	GrStringDraw(pContext, "BT DUT mode is on", -1, 32, 50, 0); 		  break; 		} 		default: 		return 0;	}	return 1;}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:28,


示例18: test_mpu6050

uint8_t test_mpu6050(uint8_t ev, uint16_t lparam, void* rparam){	switch(ev)	{		case EVENT_WINDOW_CREATED:		data = mpu6050_selftest();		break;		case EVENT_KEY_PRESSED:		{			if (lparam == KEY_ENTER)			{				data = mpu6050_selftest();  			window_invalid(NULL);			}			break;		}		case EVENT_WINDOW_PAINT:		{		  tContext *pContext = (tContext*)rparam;		  GrContextForegroundSet(pContext, ClrBlack);		  GrRectFill(pContext, &client_clip);		  GrContextForegroundSet(pContext, ClrWhite);      GrContextFontSet(pContext, (tFont*)&g_sFontGothic18);		  if (data == 0)		  {				GrStringDraw(pContext, "MPU6050 passed self testing", -1, 32, 50, 0);		  }		  else		  {		  	GrStringDraw(pContext, "MPU6050 failed self testing", -1, 32, 50, 0);		  }		  GrStringDraw(pContext, "watch face up", -1, 32, 70, 0);			window_button(pContext, KEY_ENTER, "Retest"); 		  break; 		} 		default:	 		return 0;	}	return 1;}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:47,


示例19: DrawToggle

//*****************************************************************************//// Draws a toggle button.////*****************************************************************************voidDrawToggle(const tButtonToggle *psButton, bool bOn){    tRectangle sRect;    int16_t i16X, i16Y;    //    // Copy the data out of the bounds of the button.    //    sRect = psButton->sRectButton;    GrContextForegroundSet(&g_sContext, ClrLightGrey);    GrRectFill(&g_sContext, &psButton->sRectContainer);    //    // Copy the data out of the bounds of the button.    //    sRect = psButton->sRectButton;    GrContextForegroundSet(&g_sContext, ClrDarkGray);    GrRectFill(&g_sContext, &psButton->sRectButton);    if(bOn) {        sRect.i16XMin += 2;        sRect.i16YMin += 2;        sRect.i16XMax -= 15;        sRect.i16YMax -= 2;    } else {        sRect.i16XMin += 15;        sRect.i16YMin += 2;        sRect.i16XMax -= 2;        sRect.i16YMax -= 2;    }    GrContextForegroundSet(&g_sContext, ClrLightGrey);    GrRectFill(&g_sContext, &sRect);    GrContextFontSet(&g_sContext, &g_sFontCm16);    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrLightGrey);    i16X = sRect.i16XMin + ((sRect.i16XMax - sRect.i16XMin) / 2);    i16Y = sRect.i16YMin + ((sRect.i16YMax - sRect.i16YMin) / 2);    if(bOn) {        GrStringDrawCentered(&g_sContext, psButton->pcOn, -1, i16X, i16Y,                             true);    } else {        GrStringDrawCentered(&g_sContext, psButton->pcOff, -1, i16X, i16Y,                             true);    }    if(psButton->pcLabel) {        GrStringDraw(&g_sContext, psButton->pcLabel, -1,                     psButton->sRectButton.i16XMax + 2,                     psButton->sRectButton.i16YMin + 6,                     true);    }}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:63,


示例20: InitDisplay

//*****************************************************************************//// Initialize the display.  This function is specific to the  EK-LM4F232 board// and contains nothing directly relevant to the timer configuration or// operation.////*****************************************************************************voidInitDisplay(void){    tRectangle sRect;    //    // Initialize the display driver.    //    CFAL96x64x16Init();    //    // Initialize the graphics context and find the middle X coordinate.    //    GrContextInit(&g_sContext, &g_sCFAL96x64x16);    //    // Fill the top part of the screen with blue to create the banner.    //    sRect.i16XMin = 0;    sRect.i16YMin = 0;    sRect.i16XMax = GrContextDpyWidthGet(&g_sContext) - 1;    sRect.i16YMax = 9;    GrContextForegroundSet(&g_sContext, ClrDarkBlue);    GrRectFill(&g_sContext, &sRect);    //    // Change foreground for white text.    //    GrContextForegroundSet(&g_sContext, ClrWhite);    //    // Put the application name in the middle of the banner.    //    GrContextFontSet(&g_sContext, g_psFontFixed6x8);    GrStringDrawCentered(&g_sContext, "edge-count", -1,                         GrContextDpyWidthGet(&g_sContext) / 2, 4, 0);    //    // Initialize timer status display.    //    GrContextFontSet(&g_sContext, g_psFontFixed6x8);    GrStringDraw(&g_sContext, "Countdown:", -1, 8, 26, 0);    GrStringDraw(&g_sContext, "Interrupts:", -1, 8, 36, 0);}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:51,


示例21: print_string

void print_string(int column,int row,char *s){    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrWhite);    GrStringDraw(&g_sContext,    		s,    		AUTO_STRING_LENGTH,    		column,    		row,OPAQUE_TEXT);}
开发者ID:ansonb,项目名称:CCS-codes-backup,代码行数:10,


示例22: print_char

void print_char(int column,int row,const char s){    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrWhite);    char S[2] = {s, 0};    GrStringDraw(&g_sContext,    		S,    		AUTO_STRING_LENGTH,    		column,    		row,OPAQUE_TEXT);}
开发者ID:ansonb,项目名称:Msp430f5529-experimenter-board-function-library,代码行数:11,


示例23: test_codec

uint8_t test_codec(uint8_t ev, uint16_t lparam, void* rparam){	switch(ev)	{		case EVENT_WINDOW_CREATED:		codec_wakeup();		hci_send_cmd(&hci_vs_set_pcm_loopback_enable, 1);		break;		case EVENT_WINDOW_PAINT:		{		  tContext *pContext = (tContext*)rparam;		  GrContextForegroundSet(pContext, ClrBlack);		  GrRectFill(pContext, &client_clip);		  GrContextForegroundSet(pContext, ClrWhite);      	  GrContextFontSet(pContext, (tFont*)&g_sFontGothic18); 		  GrStringDraw(pContext, "Speaker is looping back to mic", -1, 0, 50, 0);  		window_volume(pContext, 30, 125, 8, codec_getvolume()); 		  window_button(pContext, KEY_UP, "+"); 		  window_button(pContext, KEY_DOWN, "-"); 		  break; 		} 		case EVENT_KEY_PRESSED:		  switch(lparam)		      {		      case KEY_UP:		        {		          codec_changevolume(+1);		          break;		        }		      case KEY_DOWN:		        {		          // decrease voice		          codec_changevolume(-1);		          break;		        }					}					window_invalid(NULL);			break;		case EVENT_EXIT_PRESSED:		hci_send_cmd(&hci_vs_set_pcm_loopback_enable, 1);		codec_suspend();		return 0; // return 0 to close the window		default:		return 0;	}	return 1;}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:54,


示例24: PrintBasTmpActive

void PrintBasTmpActive(tContext *context, y_menus f_menuChoice){    char outString[32];    unsigned char text_start = 18;    // Draw top and bottom banner and buttons	LoadLeftButton( context , "BACK");	LoadMiddleButton( context , "SEL");	//LoadRightButton("");	// Menu options	GrStringDraw(context, "Start Profile", AUTO_STRING_LENGTH, 5, 18, OPAQUE_TEXT);	GrStringDraw(context, "Stop Temporary", AUTO_STRING_LENGTH, 5, 31, OPAQUE_TEXT);	GrStringDraw(context, "Manage Profiles", AUTO_STRING_LENGTH, 5, 44, OPAQUE_TEXT);    // Highlight selected item    switch (f_menuChoice) {    case Basal_StartProfile:        text_start = 18;        strcpy(outString, "Start Profile");        break;    case Basal_StopTmp:        text_start = 31;        strcpy(outString, "Stop Temporary");        break;    case Basal_Manage:        text_start = 44;        strcpy(outString, "Manage Profiles");        break;    default: break;    }    GrContextForegroundSet(context, ClrWhite); //ClrBlack       this affects the highlight color    GrContextBackgroundSet(context, ClrBlack);    //ClrWhite      this affects the text color in the highlight    GrStringDraw(context, outString, AUTO_STRING_LENGTH, 5, text_start, OPAQUE_TEXT);	GrContextForegroundSet(context, ClrBlack);	GrContextBackgroundSet(context, ClrWhite);}
开发者ID:GevenM,项目名称:giip,代码行数:39,


示例25: print_int

void print_int(int column,int row,int n){    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrWhite);    char s[10];    snprintf(s,10,"%d",n);    GrStringDraw(&g_sContext,    		s,    		AUTO_STRING_LENGTH,    		column,    		row,TRANSPARENT_TEXT);}
开发者ID:ansonb,项目名称:CCS-codes-backup,代码行数:13,


示例26: OnPaint

//*****************************************************************************//// The function that is called when the help text canvas is painted to the// screen.////*****************************************************************************static voidOnPaint(tWidget *pWidget, tContext *pContext){    unsigned long ulIdx;    tRectangle sRect;    //    // Prepare the drawing context.    //    GrContextForegroundSet(pContext, ClrWhite);    GrContextFontSet(pContext, g_pFontFixed6x8);    //    // Loop through the ten lines of the display.    //    for(ulIdx = 0; ulIdx < 10; ulIdx++)    {        //        // See if this line of help text is a heading.        //        if(g_ppcHelpText[g_ulDelta + ulIdx][0] == '/001')        {            //            // Draw a shaded rectangle across this entire line of the display.            //            sRect.sXMin = 0;            sRect.sYMin = (ulIdx * 8) + 16;            sRect.sXMax = 127;            sRect.sYMax = sRect.sYMin + 7;            GrContextForegroundSet(pContext, ClrSelected);            GrRectFill(pContext, &sRect);            //            // Draw this line of text centered on the display.            //            GrContextForegroundSet(pContext, ClrWhite);            GrStringDrawCentered(pContext,                                 g_ppcHelpText[g_ulDelta + ulIdx] + 1, -1, 63,                                 (ulIdx * 8) + 19, 0);        }        else        {            //            // Draw this line of text on the display.            //            GrStringDraw(pContext, g_ppcHelpText[g_ulDelta + ulIdx], -1, 0,                         (ulIdx * 8) + 16, 0);        }    }}
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:56,


示例27: UpdateStatus

//*****************************************************************************//// This function updates the status area of the screen.  It uses the current// state of the application to print the status bar.////*****************************************************************************voidUpdateStatus(char *pcString, tBoolean bClrBackground){    tRectangle sRect;    //    // Fill the bottom rows of the screen with blue to create the status area.    //    sRect.sXMin = 0;    sRect.sYMin = GrContextDpyHeightGet(&g_sContext) -                  DISPLAY_BANNER_HEIGHT - 1;    sRect.sXMax = GrContextDpyWidthGet(&g_sContext) - 1;    sRect.sYMax = sRect.sYMin + DISPLAY_BANNER_HEIGHT;    //    //    //    GrContextBackgroundSet(&g_sContext, DISPLAY_BANNER_BG);    if(bClrBackground)    {        //        // Draw the background of the banner.        //        GrContextForegroundSet(&g_sContext, DISPLAY_BANNER_BG);        GrRectFill(&g_sContext, &sRect);        //        // Put a white box around the banner.        //        GrContextForegroundSet(&g_sContext, DISPLAY_BANNER_FG);        GrRectDraw(&g_sContext, &sRect);    }    //    // Write the current state to the left of the status area.    //    GrContextFontSet(&g_sContext, g_pFontFixed6x8);    //    // Update the status on the screen.    //    if(pcString != 0)    {        GrStringDraw(&g_sContext, pcString, -1, 4, sRect.sYMin + 4, 1);    }}
开发者ID:yangjunjiao,项目名称:Luminary-Micro-Library,代码行数:53,


示例28: window_selecttext

void window_selecttext(tContext *pContext, const char* pcString, long lLength, long lX, long lY){  int height = GrStringHeightGet(pContext);  int width, textwidth;  if (lLength == -1)  {    width = GrStringWidthGet(pContext, pcString, lLength);    textwidth = width;  }  else  {    char data = '8';    width = GrStringWidthGet(pContext, &data, 1) * lLength;    textwidth = GrStringWidthGet(pContext, pcString, lLength);  }	  tRectangle rect = {lX - 2, lY - 2, lX + width + 2, lY + height + 2};  GrContextForegroundSet(pContext, ClrWhite);#if defined(PRODUCT_W002) || defined(PRODUCT_W004)  	GrRectFillRound(pContext, &rect, 0);#else    GrRectFillRound(pContext, &rect, 3);#endif    GrContextForegroundSet(pContext, ClrBlack);  GrStringDraw(pContext, pcString, lLength, lX + (width - textwidth)/2, lY, 0);  GrContextForegroundSet(pContext, ClrWhite);#if defined(PRODUCT_W002) || defined(PRODUCT_W004)  #else  // there is something more  long x = lX + width/2;  long y0 = lY - 5 - 6;  long y1 = lY + height + 5 + 6;  for(int i = 0; i < 6; i++)  {    GrLineDrawH(pContext, x - i, x + i,  y1 - i);    GrLineDrawH(pContext, x - i, x + i,  y0 + i);  }#endif  }
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:45,


示例29: output

void output(int n,int (*drawArray)[10]) {    int i,j;    static char pcCanvasText[5];    GrContextForegroundSet(&context, ClrSilver);    GrContextFontSet(&context, &g_sFontCm20);    for ( i = 0; i < 4; ++i) {        for ( j = 0; j < 4; ++j) {//			 printf("%d",drawArray[i][j]);            usprintf(pcCanvasText, "%3d", drawArray[i][j]);            GrStringDraw(&context, pcCanvasText, -1, 64+i*48 +1, 24+j*48 +1, 0);        }    }}
开发者ID:jay88159,项目名称:ColorRun_Game,代码行数:19,



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


C++ GrStringDrawCentered函数代码示例
C++ GrSetGCForeground函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。