getdefaultpalette

getdefaultpalette_3分词条

 

目录 [隐藏]

getdefaultpalette 函数功能

       

函数名: getdefaultpalette
功 能: 返回调色板定义结构
用 法: struct palettetype *far getdefaultpalette(void);

getdefaultpalette 程序示例

       

#include
#include
#include
#include

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int i;

/* structure for returning palette copy */
struct palettetype far *pal=(void *) 0;

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n",
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
/* terminate with an error code */
exit(1);
}

setcolor(getmaxcolor());

/* return a pointer to the default palette */
pal = getdefaultpalette();

for (i=0; i<16; i++)
{
printf("colors[%d] = %d\n", i,
pal->colors);
getch();
}

/* clean up */
getch();
closegraph();
return 0;
}

附图

上传图片 

互动百科的词条(含所附图片)系由网友上传,如果涉嫌侵权,请与客服联系,我们将按照法律之相关规定及时进行处理。如需转载,请注明来源于www.hudong.com

被引用: 本词条已被如下媒体引用 我来补充
开放分类: 我来补充

讨论区

更多>>

编辑者

共1人协作

相关词条

asp
nesC
分析学
pascal语言教程part-2
积分学
OLLYDBG
复变函数论
数组
约束优化方法
函数
更多

Copyright © 2005-2009 hudong.com Ltd. All Rights Reserved. 互动在线 版权所有