Skip to main content

Posts

Showing posts with the label Languages,Php

PHP | imagealphablending() Function

The imagealphablending() function is an inbuilt function in PHP which is used to set the blending mode for an image. This function allows to two different modes (blending mode and non-blending mode) to drawing truecolor images. Blending mode is not available when drawing used palette images. Syntax: bool imagealphablending( $image, $blendmode ) Parameters: This function accepts two parameters as mentioned above and described below: $image: It is returned by one of the image creation functions, such as imagecreatetruecolor(). It is used to create size of image. $blendmode: This parameter is used to check the blending mode is enable or not. The default value is True for true color image and False otherwise. Return Value: This function returns True on success or False on failure. Below programs illustrate the imagealphablending() function in PHP: Program 1:     // Create an image of given size $image = imagecreatetruecolor(300, 50...

PHP | Imagick setResourceLimit() Function

The Imagick::setResourceLimit() function is an inbuilt function in PHP which is used to set the limit for a particular resource. Syntax: int Imagick::setResourceLimit( int $type, int $limit ) Parameters: This function accepts two parameters as mentioned above and described below: $type: It specifies an integer value corresponding to one of RESOURCETYPE constants. $limit: It specifies an integer value containing the limit. List of all RESOURCETYPE constants is given below: imagick::RESOURCETYPE_UNDEFINED (0) imagick::RESOURCETYPE_AREA (1) imagick::RESOURCETYPE_DISK (2) imagick::RESOURCETYPE_FILE (3) imagick::RESOURCETYPE_MAP (4) imagick::RESOURCETYPE_MEMORY (5) imagick::RESOURCETYPE_THREAD (6) Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below given programs illustrate the Imagick::setResourceLimit() function in PHP: Program 1:     // Create a new im...