XCreateImage — vytvoření objektu reprezentujícího obraz
#include <X11/Xlib.h>
XImage *XCreateImage( | display, | |
| visual, | ||
| depth, | ||
| format, | ||
| offset, | ||
| data, | ||
| width, | ||
| height, | ||
| bitmap_pad, | ||
bytes_per_line); |
Display * | display; |
Visual * | visual; |
unsigned int | depth; |
int | format; |
int | offset; |
char * | data; |
unsigned int | width; |
unsigned int | height; |
int | bitmap_pad; |
int | bytes_per_line; |
XOpenDisplay.DefaultVisualOfScreen.Funkce alokuje paměť pro XImage strukturu pro zadaný displej (X server). Struktura je vyplněná podle zadaných parametrů. Funkce neprovádí alokaci paměti pro samotná obrazová data. Tuto paměť musí alokovat a připravit programátor před voláním funkce XCreateImage.
FIXME:
#include <X11/Xlib.h>
⋮
Display *display;
Screen *screen;
Visual *visual;
XImage *obraz;
display = XOpenDisplay(NULL);
screen = DefaultScreenOfDisplay(display);
visual = DefaultVisualOfScreen(screen);
data = (char *)malloc(256*192*x11ui_get_display_depth);
obraz = XCreateImage(display, DefaultVisualOfScreen(screen), x11ui_get_display_depth, ZPixmap, 0, (char *)data, 256, 192, 8, 0);
Použití funkce je zdokumentováno v sekci 69.9.3 – „Obrazy (Images)“. Související funkce: XDestroyImage, XGetImage, XInitImage, XPutImage.