Arjun Thakur has Published 1109 Articles

imagecolorresolve() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:48:35

18 Views

The imagecolorresolve() function gets the index of the specified color or its closest possible alternative.Syntaximagecolorresolve (img , red , green , blue )Parametersimg: Image created with imagecreatetruecolor() function.red: The value of red component.green: The value of green component.blue: The value of blue component.ReturnThe imagecolorresolve() function returns the color index.ExampleThe following ... Read More

imagecolorresolvealpha() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:45:27

15 Views

The imagecolorresolvealpha() function is used to get the index of the specified color with alpha.Syntaximagecolorresolvealpha (img , red , green , blue , alpha )Parametersimg: Creates an image with imagecreatetruecolor().red: The red componentgreen: The green componentblue: The blue componentalpha: Value between 0 and 127. 0 indicates completely opaque while 127 ... Read More

imagecopy() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:42:43

669 Views

The imagecopy() function is used to copy part of an image.Syntaximagecopy( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h)Parametersdst_im Set destination image link resource.src_im Set source image link resource.dst_x Set x-coordinate of destination point.dst_y Set y-coordinate of destination point.src_x Set x-coordinate of source point.src_y Set y-coordinate of source point.src_w Set ... Read More

imagearc() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:24:38

244 Views

The imagearc() function is used to draw an arc.Syntaximagearc( $img, $cx, $cy, $width, $height, $start, $end, $color )Parameters$img: Creates an image with imagecreatetruecolor().$cx: x-coordinate of the center.$cy: y-coordinate of the center.$width: The width of arc.$height: The height of arc.$start: The arc start angle, in degrees.$end: The arc end angle in ... Read More

imagecolorexact() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:20:41

48 Views

The imagecolorexact() function gets the index of the specified color.Syntaximagecolorexact ( $img, $red, $green, $blue )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorexact() function returns the index of the specified color in the palette, or -1 if the color does not exist.ExampleThe ... Read More

imagepolygon() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 07:17:56

276 Views

The imagepolygon() function is used to draw a polygon.Syntaxbool imagepolygon( $img, $points, $num_points, $color)Parameters$img: Create a blank image with imagecreatetruecolor() function.$points: An array with vertices of polygon.$num_points: Total number of vertices in a polygon.$color: A color identifier created with imagecolorallocate() function.ReturnThe imagepolygon() function returns TRUE on success or FALSE on ... Read More

imagecolorat() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 06:23:18

259 Views

The imagecolorat() function gets the index of the color of the pixel.Syntaximagecolorat( $img, $x, $y )Parametersimg: Create an image with imagecreatetruecolor() function.x: The x-coordinate of the point.y: The y-coordinate of the point.ReturnThe imagecolorat() function returns the color index or FALSE on failure.ExampleThe following is an example: Live DemoOutputThe following is the ... Read More

imagefilledrectangle() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 31-Dec-2019 06:20:11

775 Views

The imagefilledrectangle() function draws a filled rectangle.Syntaximagefilledrectangle( $img, $x1, $y1, $x2, $y2, $color )Parametersimage Create a blank image with imagecreatetruecolor().x1x-coordinate for point 1.y1 y-coordinate for point 1.x2 x-coordinate for point 2.y2 y-coordinate for point 2.color The fill color.ReturnThe imagefilledrectangle() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the ... Read More

uniqid() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 30-Dec-2019 06:59:26

234 Views

The uniqid() function generates a unique ID based on the current time in microseconds.Syntaxuniqid(prefix, more_entropy)Parametersprefix − The prefix to the unique ID.more_entropy − The more entropy at the end of the return value.ReturnThe uniqid() function returns unique identifiers as string.Example Live DemoOutputThe following is the output.5bfd5bd045faaRead More

show_source() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 30-Dec-2019 06:44:49

126 Views

The show_source() function outputs a file with the PHP syntax highlighted.Syntaxshow_source(file, return)Parametersfile − The file name to display.return − If this parameter is set to true, this function will return the highlighted code as a string, instead of printing it out. Default is false.ReturnThe show_source() function returns the highlighted code ... Read More

Advertisements