wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_imagecreatetruecolor › WordPress Function

Since2.9.0
已弃用n/a
wp_imagecreatetruecolor ( $width, $height )
参数: (2)
  • (int) $width Image width in pixels.
    Required: Yes
  • (int) $height Image height in pixels.
    Required: Yes
返回:
  • (resource|GdImage|false) The GD image resource or GdImage instance on success. False on failure.
定义在:
文档:

Creates a new GD image resource with transparency support.



源码

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;
}