VgaGames4 - window man-pages

[.. upper level ..]

vg4->window->copy()

Copy image onto window.

SYNTAX
void vg4->window->copy(const struct VG_Image *imgsrc, const struct VG_Position *posdst, const struct VG_ImagecopyAttr *iattr)

FUNCTION PARAMETERS
imgsrc Source image, or NULL = actual contents of window
posdst Destination position, or NULL = copy centered onto window
iattr Image-copy attributes, or NULL

DESCRIPTION
Copy image onto window. imgsrc may be NULL for redrawing actual window-contents with modified attributes. The window contents will not be seen unless calling vg4->window->flush().

EXAMPLE
/* load image and copy it onto right upper corner of the window */

struct VG_Image *imgp;
struct VG_Position posdst;
int winw;

/* get virtual width of window */
vg4->window->getsize(&winw, NULL);

/* load myimg.bmp, assuming no error */
imgp = vg4->image->load("myimg.bmp");

/* set position */
posdst.pos = VG_POS_UPPER_RIGHT;  /* use right upper corner of the image */
posdst.x = winw - 1; posdst.y = 0;  /* put it to the right upper corner of the window */

vg4->window->copy(imgp, &posdst, NULL);

vg4->window->flush();

SEE ALSO
vg4->window->flush()