wp_imagecreatetruecolor()
Creates a new GD image resource with transparency support.
No Hooks.
Returns
resource|GdImage|false. The GD image resource or GdImage instance on success. False on failure.
Usage
wp_imagecreatetruecolor( $width, $height );
- $width(int) (required)
- Image width in pixels.
- $height(int) (required)
- Image height in pixels.
Changelog
| Since 2.9.0 | Introduced. |
wp_imagecreatetruecolor() wp imagecreatetruecolor code WP 6.9.1
function wp_imagecreatetruecolor( $width, $height ) {
$img = imagecreatetruecolor( $width, $height );
if ( is_gd_image( $img )
&& function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' )
) {
imagealphablending( $img, false );
imagesavealpha( $img, true );
}
return $img;
}