wp_imagecreatetruecolor

函数
wp_imagecreatetruecolor ( $width, $height )
参数
  • (int) $width Image width in pixels.
    Required:
  • (int) $height Image height in pixels.
    Required:
返回值
  • (resource|GdImage|false) The GD image resource or GdImage instance on success. False on failure.
定义位置
相关方法
wp_create_userwp_create_termwp_image_editorwpmu_create_userwp_create_category
引入
2.9.0
弃用
-

wp_imagecreatetruecolor: 这个函数用来创建一个具有指定宽度和高度的新真彩色图像资源。它接收两个参数,即图像的宽度和高度,并返回图像资源。

创建具有透明度支持的新的GD图像资源。

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 16:32:56

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: