Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 1130 of 3363
422 Views
imageopenpolygon() is an inbuilt function in PHP that is used to draw an open polygon on a given image.Syntaxbool imageopenpolygon(resource $image, array $points, int $num_points, int $color)Parametersimageopenpolygon() takes four different parameters: $image, $points, $num_points and$color. $image − Specifies the image resource to work on.$image − Specifies the image resource to work on.$points − Specifies the points of the polygon.$num_points − Specifies the number of points. The total number of (vertices) points must be at least three.$color − This parameter specifies the color of the polygon.Return Valuesimageopenpolygon() returns True on success and False on failure.Example 1OutputExample 2OutputRead More
2K+ Views
imageline() is an inbuilt function in PHP that is used to draw a line between two given points.Syntaxbool imageline(resource $image, int $x1, int $y1, int $x2, int $y2, int $color)Parametersimageline() takes six different parameters: $image, $x1, $y1, $x2, $y2 and $color.$image − Specifies the image resource to work on.$x1 − Specifies the starting x-coordinate.$y1 − Specifies the starting y-coordinate.$x2 − Specifies the ending x-coordinate.$y2 − Specifies the ending y-coordinate.$color − Specifies the line color and a color identifier created using imagecolorallocate() function.Return Valuesimageline() returns True on success or False on failure.Example 1 − Add a line to an imageOutputExample 2OutputRead More
168 Views
imagelayereffect() is an inbuilt function in PHP that is used to set the alpha blending flag to use layering effects. It returns True on success or False on failure.Syntaxbool imagelayereffect($image, $effect)Parametersimagelayereffect() takes two different parameters: $image and $effect.$image − This parameter is returned by the image creation function imagecreatetruecolor(). It is used to create the size of an image.$effect − This parameter is used to set the value of blending flag, using different effect constants, which are given below −IMG_EFFECT_REPLACE − It is used to set the pixel replacement. It is more similar to passing true to imagealphablending() function.IMG_EFFETC_ALPHABLEND − ... Read More
265 Views
imageistruecolor() is an inbuilt function in PHP that is used to check if a given image is a true-color image or not. In a true-color image, each pixel is specified by the RGB (Red, Green, and Blue) color values.Syntaxbool imageistruecolor(resource $image)Parametersimageistruecolor() takes a single parameter, $image. It holds the image.Return Valuesimageistruecolor() returns True if the given image is true-color or else, it returns False if the image is not a true-color image.Example 1Output// Input RGB image// Resultant OutputThe given input image is true-color.Example 2Output// An input gray color image.// OutputThe given input image is not a true-color image.Read More
145 Views
imagegetclip() is an inbuilt PHP function that is used to get the clipping rectangle. It is used to retrieve the current clipping rectangle, the area beyond which no pixels will be drawn.Syntaxarray imagegetclip(resource $image)Parametersimagegetclip() takes only one parameter, $image. It holds the image resource returned by one of the image creation functions such as imagecreatetruecolor().Return Typesimagegetclip() returns an indexed array with the coordinates of the clipping rectangle x, y upper left corner, and x, y lower-left corner.Example 1OutputArray ( [0] => 20 [1] => 20 [2] => 90 [3] => 90 )Example 2OutputArray ( [0] => 0 [1] => 0 [2] => 611 [3] => 395 )
621 Views
imagefontwidth() is an inbuilt function in PHP that is used to get the pixel width of a character in the specified font.Syntaxint imagefontwidth(int $font)Parametersimagefontwidth() takes only one parameter, $font. It holds the font value. The $font values can be 1, 2, 3, 4, and 5 for the built-in fonts or it can be used by using imageloadfont() function for custom fonts.Return Valuesimagefontwidth() returns the pixel width of the font.Example 1 Live DemoOutputFont width: 7Example 2 Live DemoOutputFont width for the font value 1 is 5 Font width for the font value 2 is 6 Font width for the font value 3 is ... Read More
325 Views
imagefontheight() is an inbuilt function in PHP that is used to get the pixel height of a character in the specified font.Syntaxint imagefontheight(int $font)Parametersimagefontheight() takes one parameter, $font. It holds the font value. The $font values can be 1, 2, 3, 4, and 5 for the built-in fonts or it can be used by using imageloadfont() function for custom fonts.Return Valuesimagefontheight() returns the pixel height of the font.Example 1 Live DemoOutputFont height: 13Example 2 Live DemoOutputFont height for the font value 1 is 8 Font height for the font value 2 is 13 Font height for the font value 3 is ... Read More
960 Views
imagefilter() is an inbuilt function in PHP that is used to apply a given filter to an image.Syntaxbool imagefilter(resource $image, int $filtertype, int $arg1, int $arg2, int $arg3, int $arg4)Parametersimagefilter() takes six different parameters − $image, int $filtertype, int $arg1, int $arg2, int $arg3, int $arg4.$image − It holds the image resource.$filtertype − Specifies the filter to be used which is an integer.Below are the given different image filter constants −IMG_FILTER_NEGATE − Reverses all the colors of an image.IMG_FILTER_GRAYSCALE − Converts the image into the grayscale by changing the red, green, and blue components to their weighted sum.IMG_FILTER_BRIGHTNESS − Changes ... Read More
408 Views
imagefilltoborder() is an inbuilt function in PHP that is used to perform flood fill with a specific color, whose border color is defined by the border. The starting point for the fill is (x, y) or top left is (0, 0) and the region is filled with the color.Syntaxbool imagefilltoborder(resource $image, int $x, int $y, int $border, int $color)Parametersimagefilltoborder() takes five different parameters: $image, $x, $y, $border, and $color.$image − It is the image resource.$x − Specifies the x-coordinate of start.$y − Specifies the y- coordinate of start.$border − Specifies the border color.$color − Specifies the color.Return ValuesIt returns True ... Read More
450 Views
imagefilledpolygon() is an inbuilt PHP function that is used to draw a filled polygon.Syntaxbool imagefilledpolygon($image, $points, $num_points, $color)Parametersimagefilledpolygon() takes four different parameters − $image, $points, $num_points, and $color.$image − Creates a blank image in a given size using the imagecreatetruecolor() function.$points − Holds the sequential vertices of the polygon.$num_points − Contains the total number of vertices in a polygon. The total number of points/vertices must be at least three to create a polygon.$color − Contains the filled color identifier using imagecolorallocate() function.Return ValuesIt returns True on success and False on failure.Example 1OutputExample 2OutputRead More