📄 xcmsstorecolors.html
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: XcmsStoreColors</TITLE></HEAD><BODY><H1 ALIGN=center>XcmsStoreColors</H1><H2>Syntax</H2><!.IN "Color" "storing"><!.IN "XcmsStoreColors" "" "@DEF@"><CODE><PRE><B><A HREF="conversion-contexts-and-gamut-mapping.html#cmsStatus">Status</A></B> XcmsStoreColors(<B>display</B>, <B>colormap</B>, <B>colors</B>, <B>ncolors</B>, <B>compression_flags_return</B>) <A HREF="../display/opening.html#Display">Display</A> *<B>display</B>; <A HREF="./#colormap">Colormap</A> <B>colormap</B>; <A HREF="structures.html#XcmsColor">XcmsColor</A> <B>colors</B>[]; int <B>ncolors</B>; Bool <B>compression_flags_return</B>[];</PRE></CODE><H2>Arguments</H2><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>colormap</B><TD> Specifies the colormap.<TR><TD> <B>colors</B><TD> Specifies the color specification array of<A HREF="structures.html#XcmsColor">XcmsColor</A>structures, each specifying a color cell and the color to store in thatcell.Values specified in the array remain unchanged upon return.<TR><TD> <B>ncolors</B><TD> Specifies the number of <A HREF="structures.html#XcmsColor">XcmsColor</A>structures in the color specification array.<TR><TD> <B>compression_flags_return</B><TD> Returns an array of Boolean values indicating compression status.If a non-NULL pointer is supplied,each element of the array is set to<B>True</B>if the corresponding color was compressed and<B>False</B>otherwise.Pass NULL if the compression status is not useful.</TABLE><H2>Description</H2>The<B>XcmsStoreColors()</B>function converts the colors specified in the array of<A HREF="structures.html#XcmsColor">XcmsColor</A>structures into RGB values and then uses these RGB specifications in<A HREF="structures.html">XColor</A>structures, whose three flags <B>DoRed</B>, <B>DoGreen</B>,and<B>DoBlue</B>)are set, in a call to<B><A HREF="XStoreColors.html">XStoreColors()</A></B>to change the color cells specified by the pixel member of the corresponding<A HREF="structures.html#XcmsColor">XcmsColor</A>structure.Each pixel value must be a valid index for the specified colormap,and the color cell specified by each pixel value must be a read/write cell.If a pixel value is not a valid index, a<B>BadValue</B>error results.If a color cell is unallocated or is allocated read-only, a<B>BadAccess</B>error results.If more than one pixel is in error,the one that gets reported is arbitrary.If the colormap is an installed map for its screen, the changes are visible immediately.<P>Note that <B><A HREF="XStoreColors.html">XStoreColors()</A></B>has no return value; therefore, an<B><A HREF="conversion-contexts-and-gamut-mapping.html#cmsStatus">XcmsSuccess</A></B>return value from this function indicates that conversions to RGB succeeded and the call to<B><A HREF="XStoreColors.html">XStoreColors()</A></B>was made.To obtain the actual colors stored, use<B><A HREF="XcmsQueryColors.html">XcmsQueryColors()</A></B>.Due to the screen's hardware limitations or gamut compression,the colors stored in the colormap may not be identicalto the colors specified.<P><B>XcmsStoreColors()</B>can generate<B>BadAccess</B> ,<B>BadColor</B> ,and<B>BadValue</B>errors.<H2>Diagnostics</H2><TABLE><TR><TD><B>BadAccess</B><TD> A client attempted to free a color map entry thatit did not already allocate.<TR><TD><B>BadAccess</B><TD> A client attempted to store into a read-only color map entry.<TR><TD><B>BadColor</B><TD> A value for a Colormap argument does not name a defined Colormap.<TR><TD><B>BadValue</B><TD> Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.</TABLE><H2>See also</H2><B><A HREF="XcmsStoreColor.html">XcmsStoreColor()</A></B>,<B><A HREF="XcmsAllocColor.html">XcmsAllocColor()</A></B>,<B><A HREF="XcmsQueryColor.html">XcmsQueryColor()</A></B>,"<A HREF="modifying-and-querying-cells.html">Modifying and Querying Colormap Cells</A>".<HR><ADDRESS><A HREF="http://tronche.com/">Christophe Tronche</A>, <A HREF="mailto:ch.tronche@computer.org">ch.tronche@computer.org</A></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -