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

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

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

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

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

示例1: ClearRightButton

void ClearRightButton( tContext *context ){	GrContextForegroundSet( context, ClrWhite);	GrContextBackgroundSet( context, ClrBlack);	GrRectFill( context, &myRectangleBotRight);	GrContextForegroundSet( context, ClrBlack);	GrContextBackgroundSet( context, ClrWhite);}
开发者ID:GevenM,项目名称:giip,代码行数:7,


示例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: 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,


示例4: 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,


示例5: LoadLeftButton

void LoadLeftButton( tContext *context, const char * text){	GrRectFill( context, &myRectangleBotLeft);	GrContextForegroundSet( context, ClrWhite);	GrContextBackgroundSet( context, ClrBlack);	GrStringDrawCentered( context, text, AUTO_STRING_LENGTH, 14, 88, TRANSPARENT_TEXT);	GrContextForegroundSet( context, ClrBlack);	GrContextBackgroundSet( context, ClrWhite);}
开发者ID:GevenM,项目名称:giip,代码行数:9,


示例6: BlankScreen

// Needed since the TivaWare Graphics Library seems to not have a function// for clearing the display.void BlankScreen(void){    GrContextForegroundSet(&g_sContext, ClrWhite);	GrContextBackgroundSet(&g_sContext, ClrBlack);    GrRectFill(&g_sContext, &(g_sContext.sClipRegion));    GrFlush(&g_sContext);	GrContextForegroundSet(&g_sContext, ClrBlack);	GrContextBackgroundSet(&g_sContext, ClrWhite);}
开发者ID:DonaldRich,项目名称:Tiva-Sharp-LCD-Interface,代码行数:11,


示例7: SystemInit

/**********************************************************************//** * @brief  Initializes the System * * @param  none * * @return none *************************************************************************/void SystemInit(void){    // Set the DCO to 8MHz (it's also the device's power-on setting). Do not change this frequency!    // It impacts the cap touch scan window.    CS_setDCOFreq(__MSP430_BASEADDRESS_CS__, CS_DCORSEL_0, CS_DCOFSEL_6);    // Configure clock source and clock dividers. After this the clock configuration will be as follows:    // ACLK=LFXT1/1=32,768Hz; SMCLK=DCOCLK/1=8MHz; and MCLK=DCOCLK/1=8MHz.    CS_clockSignalInit(__MSP430_BASEADDRESS_CS__, CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);    CS_clockSignalInit(__MSP430_BASEADDRESS_CS__, CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);    CS_clockSignalInit(__MSP430_BASEADDRESS_CS__, CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);    // Set all GPIO to output low to minimize current draw by eliminating floating pins.    GPIO_setOutputLowOnPin(GPIO_PORT_PA, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    GPIO_setOutputLowOnPin(GPIO_PORT_PB, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    GPIO_setOutputLowOnPin(GPIO_PORT_PJ, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    GPIO_setAsOutputPin(GPIO_PORT_PA, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    GPIO_setAsOutputPin(GPIO_PORT_PB, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    GPIO_setAsOutputPin(GPIO_PORT_PJ, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN6 | GPIO_PIN7 | GPIO_PIN8 | GPIO_PIN9 | GPIO_PIN10 | GPIO_PIN11 | GPIO_PIN12 | GPIO_PIN13 | GPIO_PIN14 | GPIO_PIN15);    // Configure the left button (S2) connected to P4.6. For this enable the internal pull-up resistor and    // setup the pin interrupt to trigger on rising edges.    GPIO_setAsInputPinWithPullUpresistor(GPIO_PORT_P4, GPIO_PIN5);    GPIO_interruptEdgeSelect(GPIO_PORT_P4, GPIO_PIN5, GPIO_LOW_TO_HIGH_TRANSITION);    GPIO_clearInterruptFlag(GPIO_PORT_P4, GPIO_PIN5);    GPIO_enableInterrupt(GPIO_PORT_P4, GPIO_PIN5);    // Configure the right button (S3) connected to P1.1. For this enable the internal pull-up resistor and    // setup the pin interrupt to trigger on rising edges.    GPIO_setAsInputPinWithPullUpresistor(GPIO_PORT_P1, GPIO_PIN1);    GPIO_interruptEdgeSelect(GPIO_PORT_P1, GPIO_PIN1, GPIO_LOW_TO_HIGH_TRANSITION);    GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);    GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);    // CapSense Setup. GPIO pins P1.3-1.5 and P3.4-3.6 are used for capacitive touch so let's    // switch them to inputs. //   GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN3 | GPIO_PIN4 | GPIO_PIN5);    GPIO_setAsInputPin(GPIO_PORT_P3, GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6);    // Enable LFXT functionality on PJ.4 and PJ.5. For this we only need to configure PJ.4 to    // LFXIN and the port module logic takes care of the rest.    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_PJ, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION);    // Disable the GPIO power-on default high-impedance mode to activate previously configured port settings    PMM_unlockLPM5(__MSP430_BASEADDRESS_PMM_FRAM__);    // Perform the required LFXT startup procedure now that all of the port pins are configured.    CS_setExternalClockSource(__MSP430_BASEADDRESS_CS__, 32768, 0);    CS_LFXTStart(__MSP430_BASEADDRESS_CS__, CS_LFXT_DRIVE0);    // Initialize LCD driver and the context for the LCD    Sharp96x96_LCDInit();    TA0_enableVCOMToggle();    GrContextInit(&sContext, &g_sharp96x96LCD);    GrContextForegroundSet(&sContext, ClrBlack);    GrContextBackgroundSet(&sContext, ClrWhite);    onLED();                                   //blink LED1}
开发者ID:Michael-DeSando,项目名称:BMS,代码行数:67,


示例8: vApplicationStackOverflowHook

//*****************************************************************************//// This hook is called by FreeRTOS when an stack overflow error is detected.////*****************************************************************************voidvApplicationStackOverflowHook(xTaskHandle *pxTask, signed char *pcTaskName){    tContext sContext;    //    // A fatal FreeRTOS error was detected, so display an error message.    //    GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);    GrContextForegroundSet(&sContext, ClrRed);    GrContextBackgroundSet(&sContext, ClrBlack);    GrContextFontSet(&sContext, g_psFontCm20);    GrStringDrawCentered(&sContext, "Fatal FreeRTOS error!", -1,                         GrContextDpyWidthGet(&sContext) / 2,                         (((GrContextDpyHeightGet(&sContext) - 24) / 2) +                          24), 1);    //    // This function can not return, so loop forever.  Interrupts are disabled    // on entry to this function, so no processor interrupts will interrupt    // this loop.    //    while(1)    {    }}
开发者ID:RevaReva,项目名称:tiva-c,代码行数:31,


示例9: SafeRTOSErrorHook

//*****************************************************************************//// This hook is called by SafeRTOS when an error is detected.////*****************************************************************************static voidSafeRTOSErrorHook(xTaskHandle xHandleOfTaskWithError,                  signed portCHAR *pcNameOfTaskWithError,                  portBASE_TYPE xErrorCode){    tContext sContext;    //    // A fatal SafeRTOS error was detected, so display an error message.    //    GrContextInit(&sContext, &g_sKitronix320x240x16_SSD2119);    GrContextForegroundSet(&sContext, ClrRed);    GrContextBackgroundSet(&sContext, ClrBlack);    GrContextFontSet(&sContext, g_pFontCm20);    GrStringDrawCentered(&sContext, "Fatal SafeRTOS error!", -1,                         GrContextDpyWidthGet(&sContext) / 2,                         (((GrContextDpyHeightGet(&sContext) - 24) / 2) +                          24), 1);    //    // This function can not return, so loop forever.  Interrupts are disabled    // on entry to this function, so no processor interrupts will interrupt    // this loop.    //    while(1)    {    }}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:33,


示例10: lcd_init

void lcd_init(){	Dogs102x64_UC1701Init();	GrContextInit(&g_sContext, &g_sDogs102x64_UC1701);	GrContextForegroundSet(&g_sContext, ClrBlack);	GrContextBackgroundSet(&g_sContext, ClrWhite);	GrContextFontSet(&g_sContext, &g_sFontFixed6x8);	GrClearDisplay(&g_sContext);}
开发者ID:ansonb,项目名称:CCS-codes-backup,代码行数:8,


示例11: 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,


示例12: 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,


示例13: 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,


示例14: 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,


示例15: 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,


示例16: AnimateButtons

//*****************************************************************************//// Animate Buttons.////*****************************************************************************voidAnimateButtons(bool bInit){    if(bInit) {        g_sButtons.i32X = 0;        g_sButtons.i32Y = 0;        g_sButtons.bEnabled = true;        g_sButtons.bActive = false;        g_sButtons.ui32Delay = 0;    } else if(g_sButtons.bEnabled == false) {        //        // Just return if the buttons are not on screen.        //        return;    }    if(g_sButtons.ui32Delay == 0) {        g_sButtons.ui32Delay = 6;        GrContextForegroundSet(&g_sContext, ClrBlack);        GrContextBackgroundSet(&g_sContext, ClrGray);        if((bInit == false) || (g_sButtons.bActive == true)) {            //            // Update the buttons.            //            DrawButtons(g_sButtons.i32X - g_sButtons.i32Y, true);            if(g_sButtons.i32X < 3) {                g_sButtons.i32X++;            } else {                g_sButtons.i32Y++;            }        }        if(g_sButtons.bActive == false) {            //            // Update the buttons.            //            DrawButtons(g_sButtons.i32X - g_sButtons.i32Y, false);            if(g_sButtons.i32Y >= 3) {                g_sButtons.bActive = true;                g_sButtons.ui32Delay = 6;            }        } else if((g_i32ScreenIdx == SCREEN_SUMMARY) ||                  (g_i32ScreenIdx == SCREEN_DETAILS)) {            ButtonsDisable();        }    }}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:56,


示例17: configDisplay

void configDisplay(void){    // Enable use of external clock crystals    P5SEL |= (BIT5|BIT4|BIT3|BIT2);    // Set up LCD -- These function calls are part on a TI supplied library    Dogs102x64_UC1701Init();    GrContextInit(&g_sContext, &g_sDogs102x64_UC1701);    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrWhite);    GrContextFontSet(&g_sContext, &g_sFontFixed6x8);    GrClearDisplay(&g_sContext);    GrFlush(&g_sContext);}
开发者ID:Lumbini,项目名称:MSP430_Hero,代码行数:14,


示例18: 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,


示例19: devpkLcdInvert

/******************************************************************************* * @fn          devpkLcdInvert * * @brief       Inverts the foreground and background colours * * @return      true if success */bool devpkLcdInvert(void){  if (hLcdPin != NULL)  {    uint32_t tmp;    // Swap background and foreground    tmp = display.fg;    display.fg = display.bg;    display.bg = tmp;    GrContextForegroundSet(&g_sContext, display.fg);    GrContextBackgroundSet(&g_sContext, display.bg);    GrClearDisplay(&g_sContext);    GrFlush(&g_sContext);  }  return hLcdPin != 0;}
开发者ID:ClarePhang,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:27,


示例20: ClearTextBox

//*****************************************************************************//// This function clears out the text area used to display the directory// contents.//// /param None.//// This function is used to clear out the text area used to display the// directory contents.//// /return None.////*****************************************************************************voidClearTextBox(void){    tRectangle TextBox;    TextBox.sXMin = 0;    TextBox.sYMin = TOP_HEIGHT;    TextBox.sXMax = g_sFormike128x128x16.usWidth - 1;    TextBox.sYMax = g_sFormike128x128x16.usHeight - 1;    //    // Set the fill color.    //    GrContextForegroundSet(&g_sContext, BACKGROUND_COLOR);    //    // Fill the text area with the fill color.    //    GrRectFill(&g_sContext, &TextBox);    GrContextForegroundSet(&g_sContext, FILE_COLOR);    GrContextBackgroundSet(&g_sContext, ClrBlack);}
开发者ID:fejerson108,项目名称:Stellarisware,代码行数:36,


示例21: vShowBootText

/** * Show the Text for the Bootscreen */void vShowBootText(char* text){	/* Header Rectangle */	tRectangle sRect;	if (g_sContext.pDisplay == 0)	{		GrContextInit(&g_sContext, DISPLAY_DRIVER);	}	//	// Fill the top 24 rows of the screen with blue to create the banner.	//	sRect.sXMin = 0;	sRect.sYMin = 0;	sRect.sXMax = GrContextDpyWidthGet(&g_sContext);	sRect.sYMax = GrContextDpyHeightGet(&g_sContext);	GrContextForegroundSet(&g_sContext, DISPLAY_BOOT_SCREEN_BACKGROUND_COLOR);	GrContextBackgroundSet(&g_sContext, DISPLAY_BOOT_SCREEN_BACKGROUND_COLOR);	GrRectFill(&g_sContext, &sRect);	//	// Put a white box around the banner.	//	GrRectDraw(&g_sContext, &sRect);	GrContextForegroundSet(&g_sContext, DISPLAY_BOOT_SCREEN_COLOR);	//	// Put the application name in the middle of the banner.	//	GrContextFontSet(&g_sContext, DISPLAY_BOOT_SCREEN_FONT);	GrStringDrawCentered(&g_sContext, text, -1,			GrContextDpyWidthGet(&g_sContext) / 2, GrContextDpyHeightGet(&g_sContext) / 2, 0);}
开发者ID:hitubaldaniya,项目名称:lumweb,代码行数:39,


示例22: devpkLcdOpen

/******************************************************************************* * @fn          devpkLcdOpen * * @brief       Initialize the LCD * * @descr       Initializes the pins used by the LCD, creates resource access *              protection semaphore, turns on the LCD device, initializes the *              frame buffer, initializes to white background/dark foreground, *              and finally clears the display. * * @return      true if success */bool devpkLcdOpen(void){  hLcdPin = PIN_open(&pinState, BoardDevpackLCDPinTable);  if (hLcdPin != 0)  {    display.bg = ClrBlack;    display.fg = ClrWhite;    // Open the SPI driver    bspSpiOpen();    // Exclusive access    Semaphore_Params_init(&semParamsLCD);    semParamsLCD.mode = Semaphore_Mode_BINARY;    Semaphore_construct(&semLCD, 1, &semParamsLCD);    hSemLCD = Semaphore_handle(&semLCD);    // Turn on the display    PIN_setOutputValue(hLcdPin,Board_DEVPK_LCD_DISP,1);    // Graphics library init    GrContextInit(&g_sContext, &g_sharp96x96LCD);    // Graphics properties    GrContextForegroundSet(&g_sContext, display.fg);    GrContextBackgroundSet(&g_sContext, display.bg);    GrContextFontSet(&g_sContext, &g_sFontFixed6x8);    // Clear display    GrClearDisplay(&g_sContext);    GrFlush(&g_sContext);  }  return hLcdPin != 0;}
开发者ID:ClarePhang,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:48,


示例23: ContainerPaint

//*****************************************************************************////! Draws a container widget.//!//! /param pWidget is a pointer to the container widget to be drawn.//!//! This function draws a container widget on the display.  This is called in//! response to a /b #WIDGET_MSG_PAINT message.//!//! /return None.////*****************************************************************************static voidContainerPaint(tWidget *pWidget){    tContainerWidget *pContainer;    long lX1, lX2, lY;    tContext sCtx;    //    // Check the arguments.    //    ASSERT(pWidget);    //    // Convert the generic widget pointer into a container widget pointer.    //    pContainer = (tContainerWidget *)pWidget;    //    // Initialize a drawing context.    //    GrContextInit(&sCtx, pWidget->pDisplay);    //    // Initialize the clipping region based on the extents of this container.    //    GrContextClipRegionSet(&sCtx, &(pWidget->sPosition));    //    // See if the container fill style is selected.    //    if(pContainer->ulStyle & CTR_STYLE_FILL)    {        //        // Fill the container with the fill color.        //        GrContextForegroundSet(&sCtx, pContainer->ulFillColor);        GrRectFill(&sCtx, &(pWidget->sPosition));    }    //    // See if the container text style is selected.    //    if(pContainer->ulStyle & CTR_STYLE_TEXT)    {        //        // Set the font and colors used to draw the container text.        //        GrContextFontSet(&sCtx, pContainer->pFont);        GrContextForegroundSet(&sCtx, pContainer->ulTextColor);        GrContextBackgroundSet(&sCtx, pContainer->ulFillColor);        //        // Get the width of the container text.        //        lX2 = GrStringWidthGet(&sCtx, pContainer->pcText, -1);        //        // Determine the position of the text.  The position depends on the        // the width of the string and if centering is enabled.        //        if(pContainer->ulStyle & CTR_STYLE_TEXT_CENTER)        {            lX1 = (pWidget->sPosition.sXMin +                   ((pWidget->sPosition.sXMax - pWidget->sPosition.sXMin + 1 -                     lX2 - 8) / 2));        }        else        {            lX1 = pWidget->sPosition.sXMin + 4;        }        //        // Draw the container text.        //        GrStringDraw(&sCtx, pContainer->pcText, -1, lX1 + 4,                     pWidget->sPosition.sYMin,                     pContainer->ulStyle & CTR_STYLE_TEXT_OPAQUE);        //        // See if the container outline style is selected.        //        if(pContainer->ulStyle & CTR_STYLE_OUTLINE)        {            //            // Get the position of the right side of the string.            //            lX2 = lX1 + lX2 + 8;//.........这里部分代码省略.........
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:101,


示例24: CheckBoxPaint

//.........这里部分代码省略.........    // Draw an "X" in the check box.    //    GrLineDraw(&sCtx, sRect.sXMin + 1, sRect.sYMin + 1, sRect.sXMax - 1,               sRect.sYMax - 1);    GrLineDraw(&sCtx, sRect.sXMin + 1, sRect.sYMax - 1, sRect.sXMax - 1,               sRect.sYMin + 1);    //    // See if the check box text or image style is selected.    //    if((pCheck->usStyle & (CB_STYLE_TEXT | CB_STYLE_IMG)) && !bClick)    {        //        // Shrink the clipping region by the size of the check box so that it        // is not overwritten by further "decorative" portions of the widget.        //        sCtx.sClipRegion.sXMin += pCheck->usBoxSize + 4;        //        // If the check box outline style is selected then shrink the clipping        // region by one pixel on each side so that the outline is not        // overwritten by the text or image.        //        if(pCheck->usStyle & CB_STYLE_OUTLINE)        {            sCtx.sClipRegion.sYMin++;            sCtx.sClipRegion.sXMax--;            sCtx.sClipRegion.sYMax--;        }        //        // See if the check box image style is selected.        //        if(pCheck->usStyle & CB_STYLE_IMG)        {            //            // Determine where along the Y extent of the widget to draw the            // image.  It is drawn at the top if it takes all (or more than            // all) of the Y extent of the widget, and it is drawn centered if            // it takes less than the Y extent.            //            if(GrImageHeightGet(pCheck->pucImage) >               (sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin))            {                lY = sCtx.sClipRegion.sYMin;            }            else            {                lY = (sCtx.sClipRegion.sYMin +                      ((sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin -                        GrImageHeightGet(pCheck->pucImage) + 1) / 2));            }            //            // Set the foreground and background colors to use for 1 BPP            // images.            //            GrContextForegroundSet(&sCtx, pCheck->ulTextColor);            GrContextBackgroundSet(&sCtx, pCheck->ulFillColor);            //            // Draw the image next to the check box.            //            GrImageDraw(&sCtx, pCheck->pucImage, sCtx.sClipRegion.sXMin, lY);        }        //        // See if the check box text style is selected.        //        if(pCheck->usStyle & CB_STYLE_TEXT)        {            //            // Determine where along the Y extent of the widget to draw the            // string.  It is drawn at the top if it takes all (or more than            // all) of the Y extent of the widget, and it is drawn centered if            // it takes less than the Y extent.            //            if(GrFontHeightGet(pCheck->pFont) >               (sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin))            {                lY = sCtx.sClipRegion.sYMin;            }            else            {                lY = (sCtx.sClipRegion.sYMin +                      ((sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin -                        GrFontHeightGet(pCheck->pFont) + 1) / 2));            }            //            // Draw the text next to the check box.            //            GrContextFontSet(&sCtx, pCheck->pFont);            GrContextForegroundSet(&sCtx, pCheck->ulTextColor);            GrContextBackgroundSet(&sCtx, pCheck->ulFillColor);            GrStringDraw(&sCtx, pCheck->pcText, -1, sCtx.sClipRegion.sXMin,                         lY, pCheck->usStyle & CB_STYLE_TEXT_OPAQUE);        }    }}
开发者ID:hitubaldaniya,项目名称:lumweb,代码行数:101,


示例25: RadioButtonPaint

//.........这里部分代码省略.........    //    // Fill in the radio button.    //    GrCircleFill(&sCtx, i32X, i32Y, (pRadio->ui16CircleSize / 2) - 2);    //    // See if the radio button text or image style is selected.    //    if((pRadio->ui16Style & (RB_STYLE_TEXT | RB_STYLE_IMG)) && !bClick)    {        //        // Shrink the clipping region by the size of the radio button so that        // it is not overwritten by further "decorative" portions of the        // widget.        //        sCtx.sClipRegion.i16XMin += pRadio->ui16CircleSize + 4;        //        // If the radio button outline style is selected then shrink the        // clipping region by one pixel on each side so that the outline is not        // overwritten by the text or image.        //        if(pRadio->ui16Style & RB_STYLE_OUTLINE)        {            sCtx.sClipRegion.i16YMin++;            sCtx.sClipRegion.i16XMax--;            sCtx.sClipRegion.i16YMax--;        }        //        // See if the radio button image style is selected.        //        if(pRadio->ui16Style & RB_STYLE_IMG)        {            //            // Determine where along the Y extent of the widget to draw the            // image.  It is drawn at the top if it takes all (or more than            // all) of the Y extent of the widget, and it is drawn centered if            // it takes less than the Y extent.            //            if(GrImageHeightGet(pRadio->pui8Image) >                    (sCtx.sClipRegion.i16YMax - sCtx.sClipRegion.i16YMin))            {                i32Y = sCtx.sClipRegion.i16YMin;            }            else            {                i32Y = (sCtx.sClipRegion.i16YMin +                        ((sCtx.sClipRegion.i16YMax - sCtx.sClipRegion.i16YMin -                          GrImageHeightGet(pRadio->pui8Image) + 1) / 2));            }            //            // Set the foreground and background colors to use for 1 BPP            // images.            //            GrContextForegroundSet(&sCtx, pRadio->ui32TextColor);            GrContextBackgroundSet(&sCtx, pRadio->ui32FillColor);            //            // Draw the image next to the radio button.            //            GrImageDraw(&sCtx, pRadio->pui8Image, sCtx.sClipRegion.i16XMin,                        i32Y);        }        //        // See if the radio button text style is selected.        //        if(pRadio->ui16Style & RB_STYLE_TEXT)        {            //            // Determine where along the Y extent of the widget to draw the            // string.  It is drawn at the top if it takes all (or more than            // all) of the Y extent of the widget, and it is drawn centered if            // it takes less than the Y extent.            //            if(GrFontHeightGet(pRadio->psFont) >                    (sCtx.sClipRegion.i16YMax - sCtx.sClipRegion.i16YMin))            {                i32Y = sCtx.sClipRegion.i16YMin;            }            else            {                i32Y = (sCtx.sClipRegion.i16YMin +                        ((sCtx.sClipRegion.i16YMax - sCtx.sClipRegion.i16YMin -                          GrFontHeightGet(pRadio->psFont) + 1) / 2));            }            //            // Draw the text next to the radio button.            //            GrContextFontSet(&sCtx, pRadio->psFont);            GrContextForegroundSet(&sCtx, pRadio->ui32TextColor);            GrContextBackgroundSet(&sCtx, pRadio->ui32FillColor);            GrStringDraw(&sCtx, pRadio->pcText, -1, sCtx.sClipRegion.i16XMin,                         i32Y, pRadio->ui16Style & RB_STYLE_TEXT_OPAQUE);        }    }}
开发者ID:mileat,项目名称:proj-emb,代码行数:101,


示例26: ImageButtonPaint

//*****************************************************************************////! Draws an image button.//!//! /param pWidget is a pointer to the image button widget to be drawn.//!//! This function draws a rectangular image button on the display.  This is//! called in response to a /b #WIDGET_MSG_PAINT message.//!//! /return None.////*****************************************************************************static voidImageButtonPaint(tWidget *pWidget){    const unsigned char *pucImage;    tImageButtonWidget *pPush;    tContext sCtx;    long lX, lY;    //    // Check the arguments.    //    ASSERT(pWidget);    //    // Convert the generic widget pointer into a image button widget pointer.    //    pPush = (tImageButtonWidget *)pWidget;    //    // Initialize a drawing context.    //    GrContextInit(&sCtx, pWidget->pDisplay);    //    // Initialize the clipping region based on the extents of this rectangular    // image button.    //    GrContextClipRegionSet(&sCtx, &(pWidget->sPosition));    //    // Compute the center of the image button.    //    lX = (pWidget->sPosition.sXMin +          ((pWidget->sPosition.sXMax - pWidget->sPosition.sXMin + 1) / 2));    lY = (pWidget->sPosition.sYMin +          ((pWidget->sPosition.sYMax - pWidget->sPosition.sYMin + 1) / 2));    //    // Do we need to fill the widget background with a color?    //    if(pPush->ulStyle & IB_STYLE_FILL)    {        //        // Yes. Set the appropriate color depending upon whether or not        // the widget is currently pressed.        //        GrContextForegroundSet(&sCtx,                               ((pPush->ulStyle & IB_STYLE_PRESSED) ?                                pPush->ulPressedColor :                                pPush->ulBackgroundColor));        GrRectFill(&sCtx, &(pWidget->sPosition));    }    //    // Set the foreground and background colors to use for 1 BPP    // images and text    //    GrContextForegroundSet(&sCtx, pPush->ulForegroundColor);    GrContextBackgroundSet(&sCtx,                           ((pPush->ulStyle & IB_STYLE_PRESSED) ?                            pPush->ulPressedColor :                            pPush->ulBackgroundColor));    //    // Do we need to draw the background image?    //    if(!(pPush->ulStyle & IB_STYLE_IMAGE_OFF))    {        //        // Get the background image to be drawn.        //        pucImage = ((pPush->ulStyle & IB_STYLE_PRESSED) ?                    pPush->pucPressImage : pPush->pucImage);        //        // Draw the image centered in the image button.        //        GrImageDraw(&sCtx, pucImage, lX - (GrImageWidthGet(pucImage) / 2),                    lY - (GrImageHeightGet(pucImage) / 2));    }    //    // Adjust the drawing position if the button is pressed.    //    lX += ((pPush->ulStyle & IB_STYLE_PRESSED) ? pPush->sXOffset : 0);    lY += ((pPush->ulStyle & IB_STYLE_PRESSED) ? pPush->sYOffset : 0);    ////.........这里部分代码省略.........
开发者ID:VENGEL,项目名称:StellarisWare,代码行数:101,


示例27: ClockSetPaint

//*****************************************************************************////! Paints the clock set widget on the display.//!//! /param psWidget is a pointer to the clock setting widget to be drawn.//!//! This function draws the date and time fields of the clock setting widget//! onto the display.  One of the fields can be highlighted.  This is//! called in response to a /b WIDGET_MSG_PAINT message.//!//! /return None.////*****************************************************************************static voidClockSetPaint(tWidget *psWidget){    tClockSetWidget *psClockWidget;    tContext sContext;    tRectangle sRect, sRectSel;    struct tm *psTime;    char pcBuf[8];    int32_t i32X, i32Y, i32Width, i32Height;    uint32_t ui32Idx, ui32FontHeight, ui32FontWidth, ui32SelWidth;    //    // Check the arguments.    //    ASSERT(psWidget);    ASSERT(psWidget->psDisplay);    //    // Convert the generic widget pointer into a clock set widget pointer.    //    psClockWidget = (tClockSetWidget *)psWidget;    ASSERT(psClockWidget->psTime);    //    // Get pointer to the time structure    //    psTime = psClockWidget->psTime;    //    // Initialize a drawing context.    //    GrContextInit(&sContext, psWidget->psDisplay);    //    // Initialize the clipping region based on the extents of this widget.    //    GrContextClipRegionSet(&sContext, &(psWidget->sPosition));    //    // Set the font for the context, and get font height and width - they    // are used a lot later.    //    GrContextFontSet(&sContext, psClockWidget->psFont);    ui32FontHeight = GrFontHeightGet(psClockWidget->psFont);    ui32FontWidth = GrFontMaxWidthGet(psClockWidget->psFont);    //    // Fill the widget with the background color.    //    GrContextForegroundSet(&sContext, psClockWidget->ui32BackgroundColor);    GrRectFill(&sContext, &sContext.sClipRegion);    //    // Draw a border around the widget    //    GrContextForegroundSet(&sContext, psClockWidget->ui32ForegroundColor);    GrContextBackgroundSet(&sContext, psClockWidget->ui32BackgroundColor);    GrRectDraw(&sContext, &sContext.sClipRegion);    //    // Compute a rectangle for the screen title.  Put it at the top of    // the widget display, and sized to be the height of the font, plus    // a few pixels of space.    //    sRect.i16XMin = sContext.sClipRegion.i16XMin;    sRect.i16XMax = sContext.sClipRegion.i16XMax;    sRect.i16YMin = sContext.sClipRegion.i16YMin;    sRect.i16YMax = ui32FontHeight * 2;    GrRectDraw(&sContext, &sRect);    //    // Print a title for the widget    //    GrContextFontSet(&sContext, psClockWidget->psFont);    GrStringDrawCentered(&sContext, "CLOCK SET", -1,                         (1 + sRect.i16XMax - sRect.i16XMin) / 2,                         (1 + sRect.i16YMax - sRect.i16YMin) / 2, 1);    //    // Reset the rectangle to cover the non-title area of the display    //    sRect.i16YMin = sRect.i16YMax + 1;    sRect.i16YMax = sContext.sClipRegion.i16YMax;    //    // Compute the width and height of the area remaining for showing the    // clock fields.//.........这里部分代码省略.........
开发者ID:nguyenvuhung,项目名称:TivaWare_C_Series-2.1.2.111,代码行数:101,


示例28: main

void main(void){    // Stop WDT    WDTCTL = WDTPW + WDTHOLD;    // Initialize the boards    boardInit();    clockInit();    timerInit();    flashInit();    __bis_SR_register(GIE);    // Set up the LCD    LCDInit();    GrContextInit(&g_sContext, &g_sharp96x96LCD);    GrContextForegroundSet(&g_sContext, ClrBlack);    GrContextBackgroundSet(&g_sContext, ClrWhite);    GrContextFontSet(&g_sContext, &g_sFontFixed6x8);    GrClearDisplay(&g_sContext);    GrFlush(&g_sContext);    // Intro Screen    GrStringDrawCentered(&g_sContext,                          "How to use",                          AUTO_STRING_LENGTH,                          48,                          15,                          TRANSPARENT_TEXT);    GrStringDrawCentered(&g_sContext,                          "the MSP430",                          AUTO_STRING_LENGTH,                          48,                          35,                          TRANSPARENT_TEXT);    GrStringDraw(&g_sContext,                  "Graphics Library",                  AUTO_STRING_LENGTH,                  1,                  51,                  TRANSPARENT_TEXT);    GrStringDrawCentered(&g_sContext,                          "Primitives",                          AUTO_STRING_LENGTH,                          48,                          75,                          TRANSPARENT_TEXT);    GrFlush(&g_sContext);    Delay_long();    GrClearDisplay(&g_sContext);    // Draw pixels and lines on the display    GrStringDrawCentered(&g_sContext,                          "Draw Pixels",                          AUTO_STRING_LENGTH,                          48,                          5,                          TRANSPARENT_TEXT);    GrStringDrawCentered(&g_sContext,                          "& Lines",                          AUTO_STRING_LENGTH,                          48,                          15,                          TRANSPARENT_TEXT);    GrPixelDraw(&g_sContext, 30, 30);    GrPixelDraw(&g_sContext, 30, 32);    GrPixelDraw(&g_sContext, 32, 32);    GrPixelDraw(&g_sContext, 32, 30);    GrLineDraw(&g_sContext, 35, 35, 90, 90);    GrLineDraw(&g_sContext, 5, 80, 80, 20);    GrLineDraw(&g_sContext,                0,                GrContextDpyHeightGet(&g_sContext) - 1,                GrContextDpyWidthGet(&g_sContext) - 1,                GrContextDpyHeightGet(&g_sContext) - 1);    GrFlush(&g_sContext);    Delay_long();    GrClearDisplay(&g_sContext);    // Draw circles on the display    GrStringDraw(&g_sContext,                  "Draw Circles",                  AUTO_STRING_LENGTH,                  10,                  5,                  TRANSPARENT_TEXT);    GrCircleDraw(&g_sContext, 30, 70, 20);    GrCircleFill(&g_sContext, 60, 50, 30);    GrFlush(&g_sContext);    Delay_long();    GrClearDisplay(&g_sContext);    // Draw rectangles on the display    GrStringDrawCentered(&g_sContext,                          "Draw Rectangles",                          AUTO_STRING_LENGTH,                          48,                          5,                          TRANSPARENT_TEXT);    GrRectDraw(&g_sContext, &myRectangle1);//.........这里部分代码省略.........
开发者ID:tnapiork,项目名称:all,代码行数:101,


示例29: SliderPaint

//.........这里部分代码省略.........    //    bIntersect = GrRectIntersectGet(&sClipRect, &sValueRect, &sActiveClip);    //    // Does any part of the value rectangle intersect with the region we are    // supposed to be redrawing?    //    if(bIntersect)    {        //        // Yes - we have something to draw.        //        //        // Set the new clipping rectangle.        //        GrContextClipRegionSet(&sCtx, &sActiveClip);        //        // Do we need to fill the active area with a color?        //        if(pSlider->ulStyle & SL_STYLE_FILL)        {            GrContextForegroundSet(&sCtx, pSlider->ulFillColor);            GrRectFill(&sCtx, &sValueRect);        }        //        // Do we need to draw an image in the active area?        //        if(pSlider->ulStyle & SL_STYLE_IMG)        {            GrContextForegroundSet(&sCtx, pSlider->ulTextColor);            GrContextBackgroundSet(&sCtx, pSlider->ulFillColor);            GrImageDraw(&sCtx, pSlider->pucImage,                        lX - (GrImageWidthGet(pSlider->pucImage) / 2),                        lY - (GrImageHeightGet(pSlider->pucImage) / 2));        }        //        // Do we need to render a text string over the top of the active area?        //        if(pSlider->ulStyle & SL_STYLE_TEXT)        {            GrContextFontSet(&sCtx, pSlider->pFont);            GrContextForegroundSet(&sCtx, pSlider->ulTextColor);            GrContextBackgroundSet(&sCtx, pSlider->ulFillColor);            GrStringDrawCentered(&sCtx, pSlider->pcText, -1, lX, lY,                                 pSlider->ulStyle & SL_STYLE_TEXT_OPAQUE);        }    }    //    // Now get the required clipping rectangle for the background portion of    // the slider.    //    bIntersect = GrRectIntersectGet(&sClipRect, &sEmptyRect, &sActiveClip);    //    // Does any part of the background rectangle intersect with the region we    // are supposed to be redrawing?    //    if(bIntersect)    {        //        // Yes - we have something to draw.
开发者ID:saintent,项目名称:LM4F120,代码行数:67,


示例30: main

intmain(void){    tContext sContext;    tRectangle sRect;    //    // The FPU should be enabled because some compilers will use floating-    // point registers, even for non-floating-point code.  If the FPU is not    // enabled this will cause a fault.  This also ensures that floating-    // point operations could be added to this application and would work    // correctly and use the hardware floating-point unit.  Finally, lazy    // stacking is enabled for interrupt handlers.  This allows floating-    // point instructions to be used within interrupt handlers, but at the    // expense of extra stack usage.    //    FPUEnable();    FPULazyStackingEnable();    //    // Set the clock to 40Mhz derived from the PLL and the external oscillator    //    ROM_SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |                       SYSCTL_OSC_MAIN);    //    // Initialize the display driver.    //    Adafruit320x240x16_ILI9325Init();    //    // Initialize the graphics context.    //    GrContextInit(&sContext, &g_sAdafruit320x240x16_ILI9325);    //    // Configure and enable uDMA    //    SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);    SysCtlDelay(10);    uDMAControlBaseSet(&sDMAControlTable[0]);    uDMAEnable();    //    // Initialize the touch screen driver and have it route its messages to the    // widget tree.    //    TouchScreenInit();    //    // Paint touch calibration targets and collect calibration data    //    GrContextForegroundSet(&sContext, ClrWhite);    GrContextBackgroundSet(&sContext, ClrBlack);    GrContextFontSet(&sContext, &g_sFontCm20);    GrStringDraw(&sContext, "Touch center of circles to calibrate", -1, 0, 0, 1);    GrCircleDraw(&sContext, 32, 24, 10);    GrFlush(&sContext);    TouchScreenCalibrationPoint(32, 24, 0);    GrCircleDraw(&sContext, 280, 200, 10);    GrFlush(&sContext);    TouchScreenCalibrationPoint(280, 200, 1);    GrCircleDraw(&sContext, 200, 40, 10);    GrFlush(&sContext);    TouchScreenCalibrationPoint(200, 40, 2);    //    // Calculate and set calibration matrix    //    long* plCalibrationMatrix = TouchScreenCalibrate();        //    // Write out calibration data if successful    //    if(plCalibrationMatrix)    {    	char pcStringBuf[20];    	usprintf(pcStringBuf, "A %d", plCalibrationMatrix[0]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 20, 1);    	usprintf(pcStringBuf, "B %d", plCalibrationMatrix[1]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 40, 1);    	usprintf(pcStringBuf, "C %d", plCalibrationMatrix[2]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 60, 1);    	usprintf(pcStringBuf, "D %d", plCalibrationMatrix[3]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 80, 1);    	usprintf(pcStringBuf, "E %d", plCalibrationMatrix[4]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 100, 1);    	usprintf(pcStringBuf, "F %d", plCalibrationMatrix[5]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 120, 1);    	usprintf(pcStringBuf, "Div %d", plCalibrationMatrix[6]);    	GrStringDraw(&sContext, pcStringBuf, -1, 0, 140, 1);    	TouchScreenCalibrationPoint(0,0,0);	// wait for dummy touch    }    //    // Enable touch screen event handler for grlib widgets    //    TouchScreenCallbackSet(WidgetPointerMessage);//.........这里部分代码省略.........
开发者ID:astuder,项目名称:Stellaris-grlib-driver-Adafruit-TFT-ILI9325,代码行数:101,



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


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