int wb_create_image (int width, int height)
Creates a true-color image measuring width by height pixels.
NOTE: The resulting image must be destroyed by a call to wb_destroy_image().
int wb_create_image (int width, int height [int dibbmi, int dibbits])
Special warning about using the extra parameters of wb_create_image()
This function provides access to the Windows API and should be used with great care. This function can easily generate a runtime exception or freeze the PHP application. Worse, if you are using Windows 98 or Me, it is not unlikely to crash the whole system when calling this function. For this reason Windows 98 or Windows Me are not recommended for developing WinBinder applications. Always be careful and double-check your source code before running it when using this function.
The optional dibbmi and dibbits parameters are used together to convert an image from another format to the internal Windows bitmap representation (DIB) or to create an image from raw binary data. The dibbmi parameter must be a pointer to a BITMAPINFO structure with information about the DIB, and dibbits must be a pointer to the DIB color data of the bitmap, as used in the API function SetDIBits(). For more information consult the Windows API documentation.
This feature is useful to read bitmap information from image formats that cannot be read directly by the Windows API, like PNG, JPEG, and GIF.
For example, the FreeImage library is a standalone DLL that provides a comprehensive set of image functions. This library (and other DLLs as well) can be easily integrated into WinBinder using functions wb_load_library(), wb_call_function() and wb_get_function_address(). The script freeimage.inc.php already implements some useful functions and is included in the distribution.