📄 xputimage.html
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: XPutImage</TITLE></HEAD><BODY><H1 ALIGN=center>XPutImage</H1><H2>Syntax</H2><!.IN "XPutImage" "" "@DEF@"><CODE><PRE>XPutImage(<B>display</B>, <B>d</B>, <B>gc</B>, <B>image</B>, <B>src_x</B>, <B>src_y</B>, <B>dest_x</B>, <B>dest_y</B>, <B>width</B>, <B>height</B>) <A HREF="../display/opening.html#Display">Display</A> *<B>display</B>; Drawable <B>d</B>; <A HREF="../GC/manipulating.html">GC</A> <B>gc</B>; <A HREF="images.html#XImage">XImage</A> *<B>image</B>; int <B>src_x</B>, <B>src_y</B>; int <B>dest_x</B>, <B>dest_y</B>; unsigned int <B>width</B>, <B>height</B>;</PRE></CODE><H2>Arguments</H2><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>d</B><TD> Specifies the drawable. <TR><TD> <B>gc</B><TD> Specifies the GC.<TR><TD> <B>image</B><TD> Specifies the image you want combined with the rectangle. <TR><TD> <B>src_x</B><TD> Specifies the offset in X from the left edge of the image definedby the <A HREF="images.html#XImage">XImage</A> structure.<TR><TD> <B>src_y</B><TD> Specifies the offset in Y from the top edge of the image definedby the <A HREF="images.html#XImage">XImage</A> structure.<TR><TD> <B>dest_x</B><BR> <B>dest_y</B><TD> Specify the x and y coordinates, which are relative to the origin of the drawable and are the coordinates of the subimage. <TR><TD> <B>width</B><BR> <B>height</B><TD> Specify the width and height of the subimage, which define the dimensions of the rectangle.</TABLE><H2>Description</H2>The<B>XPutImage()</B>functioncombines an image with a rectangle of the specified drawable.The section of the image defined by the src_x, src_y, width, and height arguments is drawn on the specified part of the drawable.If <B>XYBitmap</B> format is used, the depth of the image must be one,or a<B>BadMatch</B>error results.The foreground pixel in the GC defines the source for the one bits in the image,and the background pixel defines the source for the zero bits.For <B>XYPixmap</B> and <B>ZPixmap</B> , the depth of the image must match the depth of the drawable,or a<B>BadMatch</B>error results.<P>If the characteristics of the image (for example, byte_order and bitmap_unit)differ from what the server requires,<B>XPutImage()</B>automatically makes the appropriateconversions.<P>This function uses these GC components: <A HREF="../GC/manipulating.html#function">function</A>,<A HREF="../GC/manipulating.html#plane-mask">plane-mask</A>,<A HREF="../GC/manipulating.html#subwindow-mode">subwindow-mode</A>,<A HREF="../GC/manipulating.html#clip-mask">clip-x-origin</A>,<A HREF="../GC/manipulating.html#clip-mask">clip-y-origin</A>,and<A HREF="../GC/manipulating.html#clip-mask">clip-mask</A>.It also uses these GC mode-dependent components:<A HREF="../GC/manipulating.html#foreground">foreground</A> and<A HREF="../GC/manipulating.html#background">background</A>.<P><B>XPutImage()</B>can generate<B>BadDrawable</B> ,<B>BadGC</B> ,<B>BadMatch</B> ,and<B>BadValue</B> errors.<H2>Diagnostics</H2><TABLE><TR><TD><B>BadDrawable</B><TD>A value for a Drawable argument does not name a defined Window or Pixmap.<TR><TD><B>BadGC</B><TD>A value for a <B><A HREF="../my-own/gcontext.html">GContext</A></B> argument does not name a defined <B><A HREF="../my-own/gcontext.html">GContext</A></B>.<TR><TD><B>BadMatch</B><TD>An<B><A HREF="../window/create.html#InputClass">InputOnly</A></B>window is used as a Drawable.<TR><TD><B>BadMatch</B><TD>Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.<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="../utilities/XAddPixel.html">XAddPixel()</A></B>,<B><A HREF="../utilities/XCreateImage.html">XCreateImage()</A></B>,<B><A HREF="../utilities/XDestroyImage.html">XDestroyImage()</A></B>,<B><A HREF="../utilities/XGetPixel.html">XGetPixel()</A></B>,<B><A HREF="XInitImage.html">XInitImage()</A></B>,<B><A HREF="../utilities/XPutPixel.html">XPutPixel()</A></B>,<B><A HREF="XGetSubImage.html">XGetSubImage()</A></B>,"<A HREF="images.html">Transferring Images between Client and Server</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 + -