Chandu yadav has Published 1163 Articles

Make HTML5 Canvas fill the whole page

Chandu yadav

Chandu yadav

Updated on 27-Jan-2020 08:06:38

2K+ Views

To make canvas fill the whole page, you need to be 100% in width and height of the page.* {    margin: 0;    padding: 0; } body, html {    height:100%; } #canvas {    position:absolute;    height:100%; width:100%; }

Are new HTML5 elements like
and

Chandu yadav

Chandu yadav

Updated on 27-Jan-2020 06:11:15

71 Views

The elements and are useful for screenreaders as well and help visually impaired users in reading the content of your web page. These are beneficial for eBook readers as well.Let us see how to work with both the elements.           HTML Section Tag ... Read More

Does HTML5 Canvas support Double Buffering?

Chandu yadav

Chandu yadav

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

385 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

84 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

37 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

608 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

74 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

462 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

6K+ 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

2K+ 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

Advertisements