gd create <width> <height>
Return a handle to a new gdImage that is width X height.
+ gd createTrueColor <width> <height>
+ Return a handle to a new trueColor gdImage that is width X height.
+
gd createFromGD <filehandle>
gd createFromGD2 <filehandle>
gd createFromGIF <filehandle>
static cmdOptions subcmdVec[] = {
{"create", tclGdCreateCmd, 2, 2, 0, 0,
"width height"},
+ {"createTrueColor", tclGdCreateCmd, 2, 2, 0, 0,
+ "width height"},
{"createFromGD", tclGdCreateCmd, 1, 1, 0, 0,
"filehandle"},
#ifdef HAVE_LIBZ
*
* gd create <width> <height>
* Return a handle to a new gdImage that is width X height.
+ * gd createTrueColor <width> <height>
+ * Return a handle to a new trueColor gdImage that is width X height.
* gd createFromGD <filehandle>
* gd createFromGD2 <filehandle>
* gd createFromGIF <filehandle>
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
+ } else if (strcmp(cmd, "createTrueColor") == 0) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &w) != TCL_OK)
+ return TCL_ERROR;
+ if (Tcl_GetIntFromObj(interp, objv[3], &h) != TCL_OK)
+ return TCL_ERROR;
+ im = gdImageCreateTrueColor(w, h);
+ if (im == NULL) {
+ sprintf(buf, "GD unable to allocate %d X %d image", w, h);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_ERROR;
+ }
} else {
fileByName = 0; /* first try to get file from open channel */
if (Tcl_GetOpenFile