Logo Search packages:      
Sourcecode: adesklets version File versions

Imlib_Image imlib_create_image_using_data ( int  width,
int  height,
DATA32 *  data 
)

Parameters:
width The width of the image.
height The height of the image.
data The data.
Returns:
A valid image, otherwise NULL.
Creates an image from the image data specified with the width width and the height height specified. The image data data must be in the same format as imlib_image_get_data() would return. You are responsible for freeing this image data once the image is freed - Imlib2 will not do that for you. This is useful for when you already have static buffers of the same format Imlib2 uses (many video grabbing devices use such a format) and wish to use Imlib2 to render the results onto another image, or X drawable. You should free the image when you are done with it. Imlib2 returns a valid image handle on success or NULL on failure

Definition at line 2528 of file imlib2.c.

{
   ImlibImage         *im;

   if (!ctx)
      ctx = imlib_context_new();
   CHECK_PARAM_POINTER_RETURN("imlib_create_image_using_data", "data", data,
                              NULL);
   if ((width <= 0) || (height <= 0))
      return NULL;
   im = __imlib_CreateImage(width, height, data);
   if (im)
      SET_FLAG(im->flags, F_DONT_FREE_DATA);
   return (Imlib_Image) im;
}


Generated by  Doxygen 1.6.0   Back to index