gd.c | |
Functions | |
gdImageCreate | gdImageCreate is called to create palette-based images, with no more than 256 colors. |
gdImageCreateTrueColor | gdImageCreateTrueColor is called to create truecolor images, with an essentially unlimited number of colors. |
gdImageDestroy | gdImageDestroy is used to free the memory associated with an image. |
gdImagePtr gdImageCreate ( int sx, int sy )
gdImageCreate is called to create palette-based images, with no more than 256 colors. The image must eventually be destroyed using gdImageDestroy().
sx | The image width. |
sy | The image height. |
A pointer to the new image or NULL if an error occurred.
gdImagePtr im; im = gdImageCreate(64, 64); // ... Use the image ... gdImageDestroy(im);
gdImagePtr gdImageCreateTrueColor ( int sx, int sy )
gdImageCreateTrueColor is called to create truecolor images, with an essentially unlimited number of colors. Invoke gdImageCreateTrueColor with the x and y dimensions of the desired image. gdImageCreateTrueColor returns a gdImagePtr to the new image, or NULL if unable to allocate the image. The image must eventually be destroyed using <gdImageDestroy>().
Truecolor images are always filled with black at creation time. There is no concept of a “background” color index.
sx | The image width. |
sy | The image height. |
A pointer to the new image or NULL if an error occurred.
gdImagePtr im; im = gdImageCreateTrueColor(64, 64); // ... Use the image ... gdImageDestroy(im);
void gdImageDestroy ( gdImagePtr im )
gdImageDestroy is used to free the memory associated with an image. It is important to invoke gdImageDestroy before exiting your program or assigning a new image to a gdImagePtr variable.
im | Pointer to the gdImage to delete. |
Nothing.
gdImagePtr im; im = gdImageCreate(10, 10); // ... Use the image ... // Now destroy it gdImageDestroy(im);
gdImageCreate is called to create palette-based images, with no more than 256 colors.
gdImagePtr gdImageCreate ( int sx, int sy )
gdImageCreateTrueColor is called to create truecolor images, with an essentially unlimited number of colors.
gdImagePtr gdImageCreateTrueColor ( int sx, int sy )
gdImageDestroy is used to free the memory associated with an image.
void gdImageDestroy ( gdImagePtr im )