# cdCanvasPutImageRectRGB

Definition: | include pGUI.e cdCanvasPutImageRectRGB(cdCanvas canvas, atom iw, ih, sequence rgb3, atom x=0, y=0, w=0, h=0, xmin=0, xmax=0, ymin=0, ymax=0) -- or -- cdCanvasPutImageRectRGBA(cdCanvas canvas, atom iw, ih, sequence rgba, atom x=0, y=0, w=0, h=0, xmin=0, xmax=0, ymin=0, ymax=0) -- or -- cdCanvasPutImageRectMap(cdCanvas canvas, atom iw, ih, sequence index, colours, atom x=0, y=0, w=0, h=0, xmin=0, xmax=0, ymin=0, ymax=0)
Description: | Puts an image with its red, green, blue [and alpha] components defined in the three/four matrices stored in byte arrays in a specified area of the canvas.
pwa/p2js: | Not supported. (but on my wishlist)
Comments: | The (i,j) component of these matrices is at the address (j*iw+i). The pixel (0,0) is at the bottom left corner, and the pixel (iw-1,ih-1) is that the upper right corner of the image rectangle. Parameters w and h refer to the target rectangle of the canvas, so that it is possible to reduce or expand the image drawn. If w and h are 0, the size of the image is assumed (iw and ih). It also allows specifying a rectangle inside the image to be drawn, if xmin, xmax, ymin and ymax are 0 then the whole image is assumed. If the driver has bpp <=8 or only 256 colors or less, then the image is converted to 256 optimal colors using the function cdRGB2Map and is drawn using cdPutImageRectMap. cdCanvasPutImageRectMap is the same as cdCanvasPutImageRectRGB, except for the fact that the colors are provided by means of an index matrix (map). The color corresponding to a given index is given in colors[index]. The map is also a matrix stored as a byte vector. If the color vector is {}, then a vector with 256 gray tones is assumed. The wdCanvasPutImageRectRGB(), wdCanvasPutImageRectRGBA(), and wdCanvasPutImageRectMap() functions are identical, except in world coordinates.