1DTK_CREATE_IMAGE(3)           Draw Toolkit manual          DTK_CREATE_IMAGE(3)
2
3
4

NAME

6       dtk_create_image - Create and modify a shape displaying an image
7

SYNOPSIS

9       #include <drawtk.h>
10
11       dtk_hshape dtk_create_image(dtk_hshape shp,
12                       float x, float y, float width, float height,
13                       const float* color, dtk_htex image);
14

DESCRIPTION

16       dtk_create_image()  creates a rectangle of size (height,width) centered
17       at (cx,cy) containing the image loaded in texture image. The image will
18       by  stretched  to fit the size of the rectangle disregarding the dimen‐
19       sion of the image. The color argument modulates the pixel values of the
20       image,  i.e.  to  display  the image the same way it exist in the image
21       file, color should be white.
22
23       shp and color have the same usage and meaning as for other  shape  cre‐
24       ation function:
25
26        * shp  can be used to modify a previously created shape. If it is non-
27          null, the handle will be used to modify the shape referenced by shp:
28          no  new shape is created and the returned value is ensured to be shp
29          in case of success, NULL otherwise. If shp  is  NULL,  the  function
30          will attempt to create a new shape.
31
32        * color  should  point to a 4 float array containing a normalized RGBA
33          value (i.e. each component is between 0.0 and 1.0).
34

RETURN VALUE

36       In case of success these functions return the handle to the newly  cre‐
37       ated  or  modified  shape.  If the shp argument is non-null, the handle
38       returned is the same value. In case of error, NULL is returned.
39

SEE ALSO

41       dtk_destroy_shape(3), dtk_load_image(3)
42
43
44
45EPFL                                 2011                  DTK_CREATE_IMAGE(3)
Impressum