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


C++ GrContextFontSet函数代码示例

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


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

示例1: WatchdogTouchCallback

//*****************************************************************************
//
// The touch screen driver calls this function to report all state changes.
//
//*****************************************************************************
static long
WatchdogTouchCallback(unsigned long ulMessage, long lX,  long lY)
{
    //
    // If the screen is tapped, we will receive a PTR_DOWN then a PTR_UP
    // message. We pick one (pretty much at random) to use as the trigger to
    // stop feeding the watchdog.
    //
    if(ulMessage == WIDGET_MSG_PTR_UP)
    {
        //
        // Let the user know that the tap has been registered and that the
        // watchdog is being starved.
        //
        GrContextFontSet(&g_sContext, g_pFontCmss20);
        GrStringDrawCentered(&g_sContext, "Watchdog is not being fed!", -1,
                             GrContextDpyWidthGet(&g_sContext) / 2 ,
                             (GrContextDpyHeightGet(&g_sContext) / 2), 1);
        GrContextFontSet(&g_sContext, g_pFontCmss14);
        GrStringDrawCentered(&g_sContext,
                             "           System will reset shortly.           ",
                             -1, GrContextDpyWidthGet(&g_sContext) / 2 ,
                             (GrContextDpyHeightGet(&g_sContext) / 2) + 20, 1);

        //
        // Set the flag that tells the interrupt handler not to clear the
        // watchdog interrupt.
        //
        g_bFeedWatchdog = false;
    }

    return(0);
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:38,代码来源:watchdog.c

示例2: drawItem

static void drawItem(tContext *pContext, uint8_t n, char icon, const char* text, const char* value)
{
  if (icon)
    {
#if defined(PRODUCT_W002) || defined(PRODUCT_W004)
      GrContextFontSet(pContext, (tFont*)&g_sFontExIcons32);
      GrStringDraw(pContext, &icon, 1, 12, 21 + n * LINEMARGIN, 0);
#else    	
      GrContextFontSet(pContext, (tFont*)&g_sFontExIcon16);
      GrStringDraw(pContext, &icon, 1, 3, 12 + n * LINEMARGIN, 0);
#endif      
    }
    // draw text
#if defined(PRODUCT_W002) || defined(PRODUCT_W004)
  GrContextFontSet(pContext, &g_sFontBaby16);
  GrStringDraw(pContext, text, -1, 57, 24 + n * LINEMARGIN, 0);

  uint8_t width = GrStringWidthGet(pContext, value, -1);
  GrStringDraw(pContext, value, -1, 57, 39 + n * LINEMARGIN, 0);
#else  
  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);
#endif  
}
开发者ID:Sowhat2112,项目名称:KreyosFirmware,代码行数:27,代码来源:today.c

示例3: 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,代码来源:sportswatch.c

示例4: Timer1IntHandler

void Timer1IntHandler(void)
{
	//debugled(10);
    ROM_TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);

    //debugled(3);
    int angle=0;
    if(max2>0 && max1>0 && abs(maxi1-maxi2)<PULSE_SAMPLE)
    {
    //float dt=abs(maxi1-maxi2)/SAMPLING_FREQUENCY;
    //angle=asin(dt*lambda/distance)*180/3.1412;
    angle=abs(maxi1-maxi2);
    }
    //debugled(3);
    acount++;
    //rcount=0;
    //ROM_IntMasterDisable();

	snprintf(text,sizeof(text),"%3ld,%3ld",rcount,g_ulADCCount);


    GrContextForegroundSet(&sDisplayContext, ClrDarkBlue);
    GrRectFill(&sDisplayContext, &sRect1);
    GrContextForegroundSet(&sDisplayContext, ClrWhite);
    //GrRectDraw(&sDisplayContext, &sRect1);
    GrContextFontSet(&sDisplayContext, g_pFontCm12);
    GrStringDrawCentered(&sDisplayContext,text, -1,
                         GrContextDpyWidthGet(&sDisplayContext) / 2, 10, 0);

    GrContextForegroundSet(&sDisplayContext, ClrDarkBlue);
    GrRectFill(&sDisplayContext, &sRect2);
    GrContextForegroundSet(&sDisplayContext, ClrWhite);
    sprintf(text,"%4d,%4d",buffer_increment,rem);
    GrContextFontSet(&sDisplayContext, g_pFontCm12/*g_pFontFixed6x8*/);
    GrStringDrawCentered(&sDisplayContext, text, -1,
                         GrContextDpyWidthGet(&sDisplayContext) / 2,
                         ((GrContextDpyHeightGet(&sDisplayContext) - 24) / 2) + 24,
                         0);
//    GrFlush(&sDisplayContext);
    max1=0;
    max2=0;
    res=0;
    res1=0;
    maxi1=0;
    maxi2=0;
    buffer_index=0;
    for(i=0;i<buffer_size;i++)
    {
    	buffer[0][i]=0;
    	buffer[1][i]=0;
    }
    i=0;
    j=0;
    ind2=buffer_index-buffer_increment+1;




}
开发者ID:pi19404,项目名称:Embedded,代码行数:59,代码来源:acquire.c

示例5: WatchdogTouchCallback

//*****************************************************************************
//
// The touch screen driver calls this function to report all state changes.
//
//*****************************************************************************
static int32_t
WatchdogTouchCallback(uint32_t ui32Message, int32_t i32X, int32_t i32Y)
{
    //
    // If the screen is tapped, we will receive a PTR_DOWN then a PTR_UP
    // message.  Use PTR_UP as the trigger to stop feeding the watchdog.
    //
    if(ui32Message == WIDGET_MSG_PTR_UP)
    {
        //
        // See if the left or right side of the screen was touched.
        //
        if(i32X <= (GrContextDpyWidthGet(&g_sContext) / 2))
        {
            //
            // Let the user know that the tap has been registered and that the
            // watchdog0 is being starved.
            //
            GrContextFontSet(&g_sContext, g_psFontCmss20);
            GrContextForegroundSet(&g_sContext, ClrRed);
            GrStringDrawCentered(&g_sContext,
                                 "Watchdog 0 starved, reset shortly", -1,
                                 GrContextDpyWidthGet(&g_sContext) / 2 ,
                                 (GrContextDpyHeightGet(&g_sContext) / 2) + 40,
                                 1);
            GrContextForegroundSet(&g_sContext, ClrWhite);

            //
            // Set the flag that tells the interrupt handler not to clear the
            // watchdog0 interrupt.
            //
            g_bFeedWatchdog0 = false;
        }
        else
        {
            //
            // Let the user know that the tap has been registered and that the
            // watchdog1 is being starved.
            //
            GrContextFontSet(&g_sContext, g_psFontCmss20);
            GrContextForegroundSet(&g_sContext, ClrRed);
            GrStringDrawCentered(&g_sContext,
                                 "Watchdog 1 starved, reset shortly", -1,
                                 GrContextDpyWidthGet(&g_sContext) / 2 ,
                                 (GrContextDpyHeightGet(&g_sContext) / 2) + 60,
                                 1);
            GrContextForegroundSet(&g_sContext, ClrWhite);

            //
            // Set the flag that tells the interrupt handler not to clear the
            // watchdog1 interrupt.
            //
            g_bFeedWatchdog1 = false;
        }
    }

    return(0);
}
开发者ID:bli19,项目名称:unesp_mdt,代码行数:63,代码来源:watchdog.c

示例6: OnIntroPaint

//*****************************************************************************
//
// Handles paint requests for the introduction canvas widget.
//
//*****************************************************************************
void
OnIntroPaint(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,代码来源:grlib_demo.c

示例7: UIInit

//*****************************************************************************
//
// Initialize the application interface.
//
//*****************************************************************************
void
UIInit(uint32_t ui32SysClock)
{
    //
    // Initialize the display driver.
    //
    Kentec320x240x16_SSD2119Init(ui32SysClock);

    //
    // Initialize the graphics context.
    //
    GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119);

    //
    // Draw the application frame.
    //
    FrameDraw(&g_sContext, "usb-host-mouse");

    //
    // Set the font for the application.
    //
    GrContextFontSet(&g_sContext, g_psFontFixed6x8);

    //
    // Default to device type not yet updated.
    //
    g_bTypeUpdated = false;

    //
    // Initial update of the screen.
    //
    UIUpdateStatus();
}
开发者ID:AlexGeControl,项目名称:tiva-c,代码行数:38,代码来源:mouse_ui.c

示例8: 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,代码来源:alltogrtaskempty.c

示例9: SafeRTOSErrorHook

//*****************************************************************************
//
// This hook is called by SafeRTOS when an error is detected.
//
//*****************************************************************************
static void
SafeRTOSErrorHook(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,代码来源:safertos_demo.c

示例10: 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,代码来源:test.c

示例11: vApplicationStackOverflowHook

//*****************************************************************************
//
// This hook is called by FreeRTOS when an stack overflow error is detected.
//
//*****************************************************************************
void
vApplicationStackOverflowHook(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,代码来源:freertos_demo.c

示例12: OnFirmwarePaint

//*****************************************************************************
//
// Handles paint requests for the firmware update canvas widget.
//
//*****************************************************************************
void
OnFirmwarePaint(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,代码来源:lang_demo.c

示例13: UpdateStatus

//*****************************************************************************
//
// Display a status string on the LCD and also transmit it via the serial port.
//
//*****************************************************************************
void
UpdateStatus(char *pcStatus)
{
    tRectangle sRect;

    //
    // Dump that status string to the serial port.
    //
    UARTprintf("%s\n", pcStatus);

    //
    // Clear any previous status message.
    //
    sRect.i16XMin = 0;
    sRect.i16XMax = GrContextDpyWidthGet(&g_sContext) - 1;
    sRect.i16YMin = STATUS_Y - 16;
    sRect.i16YMax = STATUS_Y + 16;
    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(&g_sContext, &sRect);

    //
    // Display the new status string.
    //
    GrContextFontSet(&g_sContext, g_psFontCmss20);
    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(&g_sContext, pcStatus, -1,
                         GrContextDpyWidthGet(&g_sContext) / 2, STATUS_Y, 0);
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:33,代码来源:enet_uip.c

示例14: LCD_init

/*
 *  ======== LCD_init ========
 */
Void LCD_init()
{
    /* LCD driver init */
    Kentec320x240x16_SSD2119Init();
    GrContextInit(&context, &g_sKentec320x240x16_SSD2119);
    /* Setup font */
    GrContextFontSet(&context, g_psFontFixed6x8);
}
开发者ID:jay88159,项目名称:ColorRun_Game,代码行数:11,代码来源:Copy+of+withoutbounderempty.c

示例15: 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,代码来源:main.c


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