TA的每日心情 | 奋斗 2018-8-29 20:40 |
---|
签到天数: 1341 天 连续签到: 1 天 [LV.10]以坛为家III
|
楼主 |
发表于 2013-5-17 22:59:42
|
显示全部楼层
补充下关键的代码- int main(void)
- {
- tContext sContext;
- tRectangle sRect;
- long lLineHeight;
-
- // Set the clocking to run directly from the crystal.
- //
- ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
-
- //
- // Initialize the device pinout appropriately for this board.
- //
- PinoutSet();
-
- //
- // Initialize the display driver.
- //
- Kitronix320x240x16_SSD2119Init();
-
-
- //
- // Set graphics library text rendering defaults.
- //
- GrLibInit(&GRLIB_INIT_STRUCT);
-
- //
- // Set the string table and the default language.
- //
- GrStringTableSet(STRING_TABLE);
- //
-
- //
- // Set the default language.
- //
- ChangeLanguage(GrLangEnUS);
-
- // Initialize the graphics context.
- //
- GrContextInit(&sContext, &g_sKitronix320x240x16_SSD2119);
-
- GrContextForegroundSet(&sContext, ClrDarkBlue);
- //
- // Fill the top 24 rows of the screen with blue to create the banner.
- //
- sRect.sXMin = 0;
- sRect.sYMin = 0;
- sRect.sXMax = GrContextDpyWidthGet(&sContext) - 1;
- sRect.sYMax = 23;
- GrContextForegroundSet(&sContext, ClrDarkBlue);
- GrRectFill(&sContext, &sRect);
- //
- // Put a white box around the banner.
- //
- GrContextForegroundSet(&sContext, ClrWhite);
- GrRectDraw(&sContext, &sRect);
-
- //
- // Put the application name in the middle of the banner.
- //
- GrContextFontSet(&sContext, g_pFontCm20);
- GrStringDrawCentered(&sContext, "chinese", -1,
- GrContextDpyWidthGet(&sContext) / 2, 10, 0);
-
- // Thisfunctionreturnsastringfromthecurrentstringtable.
-
-
- GrStringLanguageSet(GrLangZhPRC);
- lLineHeight = GrFontHeightGet(FONT_20PT);
- GrContextFontSet(&sContext, FONT_20PT);
- GrStringGet(STR_INTRO_1, g_pcChinese, MAX_LANGUAGE_NAME_LEN);
- //GrStringGet(STR_INTRO_1, g_pcChinese, MAX_LANGUAGE_NAME_LEN);
- GrContextForegroundSet(&sContext, ClrSilver);
- DrawStringWrapped(&sContext, g_pcChinese, lLineHeight, 70, 32, false);
-
- GrStringGet(STR_INTRO_2, g_pcChinese, MAX_LANGUAGE_NAME_LEN);
- //GrStringGet(STR_INTRO_1, g_pcChinese, MAX_LANGUAGE_NAME_LEN);
- GrContextForegroundSet(&sContext, ClrSilver);
- DrawStringWrapped(&sContext, g_pcChinese, lLineHeight, 50, 100, false);
-
- while(1)
- {
- }
- return 0;
-
- }
复制代码 |
|