Scroll to navigation

XCreateColormap(3X11) XLIB FUNCTIONS XCreateColormap(3X11)

̾??

XCreateColormap, XCopyColormapAndFree, XFreeColormap, XColor - ???顼?ޥåפȿ???¤?Τ??????????ԡ????˴?

????

Colormap XCreateColormap(display, w, visual, alloc)
Display *display;
Window w;
Visual *visual;
int alloc;

Colormap XCopyColormapAndFree(display, colormap)
Display *display;
Colormap colormap;

XFreeColormap(display, colormap)
Display *display;
Colormap colormap;

??????

???????Ƥ????륫?顼?ޥåפΥ????ȥ꡼?????ꤹ?롣 AllocNone ?? AllocAll ???Ϥ????Ȥ??Ǥ??롣
?????????ԡ??????ꡢ?˴????Ԥ????顼?ޥåפ????ꤹ?롣
X ?????Фؤ???³?????ꤹ?롣
?????꡼?󤬥??ݡ??Ȥ??Ƥ????ӥ??奢?뷿?????ꤹ?롣 ?????꡼?󤬥??ݡ??Ȥ??Ƥʤ??ӥ??奢???ξ??硢???顼 BadMatch ?Ȥʤ롣
???顼?ޥåפ????륹???꡼????°???륦?????ɥ??????ꤹ?롣

????

?ؿ? XCreateColormap ?ϡ????ꤷ?????????ɥ??????륹???꡼?????Ф??ơ????ꤷ???ӥ??奢?뷿 ?Υ??顼?ޥåפ????????????????б????륫?顼?ޥåפ? ID ???֤??? ???ꤷ?????????ɥ??ϥ????꡼???????ꤹ?뤿???????˻Ȥ????????????դ??衣

?ӥ??奢?륯?饹 GrayScale, PseudoColor, DirectColor ???Ф??Ƥϡ????顼?ޥåץ????ȥ꡼?ν????ͤ?̤?????Ǥ??롣 StaticGray, StaticColor, TrueColor ???Ф??Ƥϡ??????ȥ꡼???????Ѥߤ??ͤ????Ĥ????????????ͤϥӥ??奢???? ??¸???????Τǡ?X ?ˤ??äƤ??????????ʤ??? StaticGray, StaticColor, TrueColor ???Ф??Ƥϡ??????? alloc ?? AllocNone ?Ǥʤ????Фʤ餺???????Ǥʤ??????ˤϥ??顼 BadMatch ?Ȥʤ롣 ???????ʳ??Υӥ??奢?륯?饹?ˤ????? alloc ?? AllocNone ?ʤ??С????顼?ޥåפˤϽ????ͤȤ??Ƴ??????Ƥ????Ƥ??륨???ȥ꡼??¸ ?ߤ????????饤?????Ȥ??????ȥ꡼?????????Ƥ뤳?Ȥ??Ǥ??롣 ?ӥ??奢?뷿?ˤĤ??Ƥξ????ϡ?3.1 ?Ϥ򻲾Ȥ??뤳?ȡ?

?????? alloc ?? AllocAll ?ξ??硢???顼?ޥå????ΤϽ񤭹??߲?ǽ?dz??????Ƥ????롣 ???????Ƥ??줿?????ȥ꡼?ν????ͤ?̤?????Ǥ??롣 GrayScale ?? PseudoColor ?????ꤹ???ȡ? XAllocColorCells ?θƤӽФ??? 0 ???? N - 1 ?ޤǤ????ƤΥԥ????????֤?????????Ʊ?????? ?ˤʤ롣?????? N ?ϻ??ꤷ???ӥ??奢???Υ??顼?ޥåץ????ȥ꡼???ͤǤ??롣 DirectColor ?????ꤹ???ȡ? XAllocColorPlanes ?θƤӽФ??? 0, red_mask, green_mask, blue_mask ?Υԥ??????ͤ??֤????? ????Ʊ?????̤ˤʤ롣???Ԥ?3?Ĥϡ????ꤷ???ӥ??奢???ˤ????Ƥ??줾???? ???????ޥ?????Ʊ???ͤ????ġ? ?????????Ƥξ????ˤ????ơ????????Υ????ȥ꡼?Τ??????? XFreeColors ?Dz??????뤳?ȤϤǤ??ʤ???

XCreateColormap ?ϥ??顼 BadAlloc, BadMatch, BadValue, BadWindow ?򵯤??????Ȥ????롣

?ؿ? XCopyColormapAndFree ?ϻ??ꤵ?줿???顼?ޥåפȥӥ??奢?뷿??Ʊ???ǡ??ޤ??оݤȤ??륹?? ?꡼??????Ʊ???Ǥ????褦?ʥ??顼?ޥåפ??????????????????顼?ޥåפ?ID ???֤??? ???δؿ??Ϥޤ??????饤?????Ȥ????߳??????ƤƤ??륨???ȥ꡼?????Ƥ??? ???ꤷ?????顼?ޥåפ??鿷???????顼?ޥåפ˰?ư?????롣???λ??Ͽ????͡? ?ɤ߼??????Ѥ??񤭹??߲?ǽ?Ǥ??뤫??°?????Ѳ??????????ꤷ?????顼?ޥ? ?פΥ????ȥ꡼?ϲ????????롣 ?????????顼?ޥåפ?¾?Υ????ȥ꡼?ˤ????뿧???ͤ?̤?????Ǥ??롣 ???ꤷ?????顼?ޥåפ??? alloc ?? AllocAll ?Ȥ??ƥ??饤?????Ȥ??????????Ƥ??????硢?????????顼?ޥåפ? AllocAll ?????????졢???ƤΥ????ȥ꡼???Ф??????Ƥο????ͤϻ??ꤷ?????顼?ޥå? ???饳?ԡ????졢?????ƻ??ꤷ?????顼?ޥåפϲ????????롣 ???ꤷ?????顼?ޥåפ??????饤?????Ȥ? AllocAll ?Ȥ????????????Ƥ??ʤ??ä??????ˤϡ???ư???????ԥ??????ȥץ졼???? ?ʲ??δؿ????Ѥ??ƥ??饤?????Ȥdz??????Ƥ??졢?????ʹ߲????????Ƥ??ʤ? ???ΤǤ???: XAllocColor, XAllocNamedColor, XAllocColorCells, XAllocColorPlanes

XCopyColormapAndFree ?ϥ??顼 BadAlloc, BadColor ?򵯤??????Ȥ????롣

XFreeColormap ?ϥ??顼?ޥåץ꥽????ID?ȥ??顼?ޥåפδ?Ϣ?Ť??????????????顼?ޥå? ?Υ??????????????롣 ???????????δؿ??ϥ????꡼???Υǥե????ȤΥ??顼?ޥåפˤ?̵???Ǥ??롣 ???ꤷ?????顼?ޥåפ??????꡼???˥??󥹥ȡ??뤵?줿???顼?ޥåפξ??硢 ???δؿ??Ϥ????򥢥󥤥󥹥ȡ??뤹??( XUninstallColormap ?򻲾?)?? ???ꤷ?????顼?ޥåפ?( XCreateWindow, XSetWindowColormap, XChangeWindowAttributes ?ˤ??ä?)???륦?????ɥ??Υ??顼?ޥåפȤ????????????Ƥ????????ˤϡ? XFreeColormap ?ϥ??????ɥ??˴?Ϣ?դ????줿???顼?ޥåפ? None ???ѹ????? ColormapNotify ???٥??Ȥ????????롣 X ?? None ?Υ??顼?ޥåפ??Ȥäƥ??????ɥ???ɽ???????뿧?ˤĤ??Ƥ????????Ƥ??ʤ???

XFreeColormap ?ϥ??顼 BadColor ?򵯤??????Ȥ????롣

??¤??

The XColor structure contains:

typedef struct {
	unsigned long pixel;	
	unsigned short red, green, blue;	
	char flags;		
	char pad;
} XColor;


red, green, blue ???ͤϾ??? 0 ?ʾ? 65535 ?ʲ??Ǥ??ꡢ?ǥ????ץ쥤?Υϡ? ?ɥ????????ºݤ˻??Ѥ????ӥåȿ??ˤϰ?¸???ʤ??? X ?????ФϤ????????ͤ??ϡ??ɥ????????Ȥ??ϰϤ?Ĵ?????롣 ???? (0,0,0) ??ɽ???졢???? (65535,65535,65535)??ɽ?????롣 ?ؿ??ˤ??äƤϡ?flags ?????Ф? red, green, blue ?Τɤ????Ȥ????????椹 ?롣???ξ??硢flags ?????Ф? DoRed, DoGreen, DoBlue ?Τ???0?İʾ??ˤĤ????????¤??Ȥä????ΤǤ??롣

?֤???

?׵ᤵ?줿?꥽?????䥵???Х??????γ??????Ƥ˥????Ф????Ԥ?????
?????? Colormap ???ͤ????????????Ƥ??? Colormap ???ؤ??Ƥ??ʤ???
An InputOnly ?Υ??????ɥ??? Drawable ?Ȥ????Ѥ????줿??
?????????????????Ȥ????????????ϰϤ????äƤ??뤬?????Υꥯ?????Ȥ??׵᤹?? ¾?ξ?????Ŭ???Ǥ??ʤ??ä???
???ꤵ?줿???ͤ????˥ꥯ?????Ȥε????ϰϤ??ۤ??Ƥ??????Τ????롣?????????? ???????????ϰϤ????ꤵ???Ƥ??ʤ????С????????η????????????Ƥ??????Ƥ??? ?Ϥ????????롣???????Ȥ????????????Ƥ??????????Ϥ??Υ??顼?򵯤??????Ȥ? ???롣
?????? Window ???ͤ????????????Ƥ??? Window ???ؤ??Ƥ??ʤ???

??Ϣ????

XAllocColor(3X11), XChangeWindowAtrributes(3X11), XCreateWindow(3X11), XQueryColor(3X11), XStoreColors(3X11)
Xlib - C Language X Interface

Release 6.5 X Version 11