Chandu yadav has Published 1091 Articles

Does HTML5 Canvas support Double Buffering?

Chandu yadav

Chandu yadav

Updated on 24-Jan-2020 10:38:56

582 Views

For double buffering on the canvas, create a 2nd canvas element and draw to it. After that draw the image to the first canvas using the drawImage() method, // canvas element var canvas1 = document.getElementById('canvas'); var context1 = canvas1.getContext('2d'); // buffer canvas var canvas2 = document.createElement('canvas'); canvas2.width = 250; ... Read More

imageconvolution() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 08:00:58

140 Views

The imageconvolution() functionSyntaxbool imageconvolution (img, matrix, div, offset )Parametersimg: Create image with imagecreatetruecolor() function.matrix: A 3x3 matrix is an array of three arrays of three floats.div: Divisor of the result of the convolution, used for normalization.offset: The color offset.ReturnThe imageconvolution() function returns True on success or False on failure.ExampleThe following ... Read More

imagecolorstotal() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 07:47:13

64 Views

The imagecolorstotal() function gets the count of colors in an image's paletteSyntaximagecolorstotal (img)Parametersimg: Image created with imagecreatetruecolor().ReturnThe imagecolorstotal() function returns the number of colors in an image palette.ExampleThe following is an example Live DemoOutputThe following is the output:Number of Colors = 128

imagecopymerge() function in PHP

Chandu yadav

Chandu yadav

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

785 Views

The imagecopymerge() function copy and merge part of an image.Syntaximagecopymerge ( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct )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 ... Read More

imagechar() function in PHP

Chandu yadav

Chandu yadav

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

143 Views

The imagechar() function draws a character horizontally.Syntaxbool imagechar( img, font, x, y, ch, color )Parametersimg: Creating an image with imagecreatetruecolor().font: Set font sizex: x-coordinatey: y-coordinatec: The character to draw.color: A color identifier created with imagecolorallocate().ReturnThe imagechar() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following ... Read More

imagecolorallocate() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 07:21:19

594 Views

The imagecolorallocate() function allocates a color for an image.Syntaxint imagecolorallocate ( $img, $red, $green, $blue )Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorallocate() function returns a color in RGB format.ExampleThe following is an example:OutputThe following is the output:

imagecreate() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 06:25:14

7K+ Views

The imagecreate() function is used to create a new image. It is preferred to use imagecreatetruecolor() to create an image instead of imagecreate(). This is because the image processing occurs on the highest quality image possible which can be created using imagecreatetruecolor().Syntaximagecreate( $width, $height )Parameterswidth: The width of imageheight: The ... Read More

getimagesize() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 06:22:42

3K+ Views

The getimagesize() function is used to display the size of an image.Syntaxgetimagesize(file_name, img_info)Parametersfile_name: The file image i.e. the image path.img_info: Extract some extended information from the image file. Supports only JFIF files.ReturnThe getimagesize() function returns an array element with height, width, type, MIME type of the image, etc.ExampleThe following is ... Read More

imagefilledellipse() function in PHP

Chandu yadav

Chandu yadav

Updated on 31-Dec-2019 06:19:07

165 Views

The imagefilledellipse() function is used to draw a filled ellipse.Syntaximagefilledellipse( $img, $cx, $cy, $width, $height, $color )Parametersimg This creates a blank image with imagecreatetruecolor()cx x-coordinate of the center.cy y-coordinate of the center.width The ellipse width.height The ellipse height.color The fill color.ReturnThe imagefilledellipse() function returns TRUE on success or FALSE on failure.ExampleThe ... Read More

unpack() function in PHP

Chandu yadav

Chandu yadav

Updated on 30-Dec-2019 07:00:49

455 Views

The unpack() function unpacks data from a binary string.Syntaxunpack(format, data)Parametersformat − The format to use. Here are the possible valuesa −NUL-padded stringA − SPACE-padded stringh − Hex string, low nibble firstH − Hex string, high nibble firstc − signed charC −unsigned chars − signed short (always 16 bit, machine byte ... Read More

Advertisements