xil_create_from_window(3)
NAME
xil_create_from_window, xil_create_from_device − create device images
SYNOPSIS
#include <xil/xil.h>
XilImage xil_create_from_window ( XilSystemState State,
Display ∗display,
Window window);
XilImage xil_create_from_device ( XilSystemState State,
char ∗devicename,
XilDevice deviceObj);
DESCRIPTION
These routines create images that are tied to particular devices. They allow X windows and various image input and output devices to be treated as if they were ordinary XIL images. After an image is created with the routines, the image can be read from the device or written to it by using the device as the source or destination of an image-processing operation.
xil_create_from_window () creates an image associated with the specified X window. Images can then be copied to this image for display. The default origin for images created with this function is (0.0, 0.0), and the default ROI is NULL.
xil_create_from_device () creates an image associated with the device named devicename. The parameter deviceObj is the handle to the device object associated with this device type; the device object is created with the xil_device_create(3) function and is used to store device-initialization values. The device object is used only for device types that require that one or more device attributes be initialized before the device image is created. If the device doesn’t require attribute initialization, the device object isn’t recongnized by the device type and you must pass NULL for the deviceObj parameter. The group that writes the device handler must indicate whether the device requires attribute initialization.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Create an XIL display image and copy it to a display image.
XilSystemState State;
XilImage display_image = NULL;
XilImage image0 = NULL;
Display ∗display;
Window window;
/∗ Create an XIL display image ∗/
display_image = xil_create_from_window(State, display, window);
/∗ Copy image0 to display image ∗/
xil_copy(image0,display_image);
NOTES
As with standard images, device images can have origins, color spaces, and so on. Subsets of device images can be referenced or written using regions of interest or child images. To resize a window that contains an XilImage, destroy the XilImage attached to the window, resize the window, wait for a ConfigureNotify event to ensure the XResizeWindow () is complete, then call xil_create_from_window () to recreate the image in the new window size. You cannot use an X window’s backing_store attribute to maintain an image in the window when the window is obscured or unmapped (see the Xlib Programming Manual). Thus, your code should always check for an Expose event and take the appropriate measures for displaying the image again when the window is exposed.
SEE ALSO
xil_get_device_attribute(3), xil_set_device_attribute(3), xil_get_readable(3), xil_get_writable(3), xil_device_create(3), xil_device_set_value(3), xil_device_destroy(3).
SunOS — Last change: 31 March 1994