这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » [求助]基于Windml的程序不能显示,请大侠们帮忙看看!仍是一筹莫展啊……

共4条 1/1 1 跳转至

[求助]基于Windml的程序不能显示,请大侠们帮忙看看!仍是一筹莫展啊……

菜鸟
2005-12-17 04:49:17     打赏

编写了一个显示字体的程序,但无论在vxsim上还是目标机上都显示不出来,附上代码,

请各位帮忙指点指点……

搞了好长时间了,编译下载都没有问题,但显示的仍就是一如既往的漆黑……现在搞的

我眼圈也要黑了……

百思不得其解啊,之前有大侠告知的前后景色设置的问题,改了好几种组合仍是不见起

色……

忘各位大侠给在黑暗中的小弟我以指点!不胜感激!

UGL_DEVICE_ID devId;
UGL_GC_ID gc;


void progstart(void)
{

UGL_FONT_DRIVER_ID fontDrvId;

UGL_FONT_DEF fontDef;
UGL_FONT_ID fontBanner;
UGL_LOCAL UGL_CHAR *text = "WindML text example.";

if (uglInitialize() == UGL_STATUS_ERROR)
{
printf("error when initializing!\n");
exit (1);
}

gc = uglGcCreate(devId);

uglDriverFind(UGL_DISPLAY_TYPE, 0, (UGL_UINT32 *)&devId);
uglDriverFind(UGL_FONT_ENGINE_TYPE, 0, (UGL_UINT32*)&fontDrvId);

if(uglFontFindString(fontDrvId, "familyName=Courier", &fontDef) ==

UGL_STATUS_ERROR)
printf("\nBanner's uglFontFindString failed.\n");

if ((fontBanner = uglFontCreate(fontDrvId, &fontDef)) == UGL_NULL)
{
printf("Font not found. Exiting.\n");
exit (1);
}

uglColorAlloc (devId, &colorTable[BLACK].rgbColor, UGL_NULL,
&colorTable[BLACK].uglColor, 1);
uglColorAlloc(devId, &colorTable[BLUE].rgbColor, UGL_NULL,
&colorTable[BLUE].uglColor, 1);
uglColorAlloc(devId, &colorTable[GREEN].rgbColor, UGL_NULL,
&colorTable[GREEN].uglColor, 1);
uglColorAlloc(devId, &colorTable[CYAN].rgbColor, UGL_NULL,
&colorTable[CYAN].uglColor, 1);
uglColorAlloc(devId, &colorTable[RED].rgbColor, UGL_NULL,
&colorTable[RED].uglColor, 1);
uglColorAlloc(devId, &colorTable[MAGENTA].rgbColor, UGL_NULL,
&colorTable[MAGENTA].uglColor, 1);
uglColorAlloc(devId, &colorTable[BROWN].rgbColor, UGL_NULL,
&colorTable[BROWN].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTGRAY].rgbColor, UGL_NULL,
&colorTable[LIGHTGRAY].uglColor, 1);
uglColorAlloc(devId, &colorTable[DARKGRAY].rgbColor, UGL_NULL,
&colorTable[DARKGRAY].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTBLUE].rgbColor, UGL_NULL,
&colorTable[LIGHTBLUE].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTGREEN].rgbColor, UGL_NULL,
&colorTable[LIGHTGREEN].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTCYAN].rgbColor, UGL_NULL,
&colorTable[LIGHTCYAN].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTRED].rgbColor, UGL_NULL,
&colorTable[LIGHTRED].uglColor, 1);
uglColorAlloc(devId, &colorTable[LIGHTMAGENTA].rgbColor, UGL_NULL,
&colorTable[LIGHTMAGENTA].uglColor, 1);
uglColorAlloc(devId, &colorTable[YELLOW].rgbColor, UGL_NULL,
&colorTable[YELLOW].uglColor, 1);
uglColorAlloc(devId, &colorTable[WHITE].rgbColor, UGL_NULL,
&colorTable[WHITE].uglColor, 1);

printf("after color!\n");
uglBatchStart(gc);
uglBackgroundColorSet(gc, colorTable[BLACK].uglColor);
uglForegroundColorSet(gc, colorTable[WHITE].uglColor);
uglLine(gc, 200,0,200,200);
uglBatchEnd(gc);

printf("after line!\n");


uglBatchStart(gc);
uglBackgroundColorSet(gc, colorTable[BLUE].uglColor);
uglForegroundColorSet(gc, colorTable[WHITE].uglColor);
uglFontSet(gc, fontBanner);
uglTextDraw(gc, 0, 0, -1, text);
uglBatchEnd(gc);

printf("after textdraw!\n");

}


[align=right][color=#000066][此贴子已经被作者于2005-12-20 0:41:14编辑过][/color][/align]



关键词: 求助     基于     Windml     程序     不能     显示     大侠         

菜鸟
2005-12-17 18:08:00     打赏
2楼
uglForegroundColorSet(gc, colorTable[BLUE].uglColor);
uglBackgroundColorSet(gc, colorTable[WHITE].uglColor);
uglBatchStart(gc);

uglFontSet(gc, fontBanner);
uglForegroundColorSet(gc, colorTable[WHITE].uglColor);
你的前景色和背景色都为白色,怎么显示出来啊!

[em06]

菜鸟
2005-12-17 21:36:00     打赏
3楼
哦?我改改试试^^^

菜鸟
2005-12-20 18:02:00     打赏
4楼
补充一下,我用T2.0,widml2.0.2,使用vxsim不行,目标机pentium的也不行……

共4条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]