imagealphablending

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

imagealphablending — �趨ͼ��Ļ�ɫģʽ

˵��

imagealphablending ( resource $image , bool $blendmode ) : bool

imagealphablending() ���������ɫͼ����ʹ�����ֲ�ͬ�Ļ滭ģʽ���ڻ�ɫ��blending��ģʽ�£�alpha ͨ��ɫ�ʳɷ��ṩ�����еĻ滭���������� imagesetpixel() �����ײ����ɫӦ�ں��̶ֳ��ϱ���������͸������Ϊ�����GD �Զ����õ����е���ɫ�ͻ�����ɫ��ϣ��������������ͼ���С�����������Dz�͸���ġ��ڷǻ�ɫģʽ�£�������ɫ��ͬ�� alpha ͨ����Ϣһ�𱻿������滻��Ŀ�����ء���ɫģʽ�ڻ���ɫ��ͼ��ʱ�����á���� blendmode Ϊ TRUE�������û�ɫģʽ������رա��ɹ�ʱ���� TRUE�� ������ʧ��ʱ���� FALSE��

Note: �˺�����Ҫ GD 2.0.1 ����߰汾(�Ƽ� 2.0.28 �����߰汾)��

����

image

��ͼ�󴴽�����(����imagecreatetruecolor())���ص�ͼ����Դ��

blendmode

Whether to enable the blending mode or not. On true color images the default value is TRUE otherwise the default value is FALSE

����ֵ

�ɹ�ʱ���� TRUE�� ������ʧ��ʱ���� FALSE��

����

Example #1 imagealphablending() usage example

<?php
// Create image
$im = imagecreatetruecolor(100, 100);

// Set alphablending to on
imagealphablending($im, true);

// Draw a square
imagefilledrectangle($im, 30, 30, 70, 70, imagecolorallocate($im, 255, 0, 0));

// Output
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>

ע��

Note: �˺�����Ҫ GD 2.0.1 ����߰汾(�Ƽ� 2.0.28 �����߰汾)��