Samual Sam has Published 2492 Articles

HTML5 Canvas Transformation Matrix

Samual Sam

Samual Sam

Updated on 25-Jun-2020 06:35:48

379 Views

HTML5 canvas provides methods that allow modifications directly to the transformation matrix. The transformation matrix must initially be the identity transform. It may then be adjusted using the transformation methods.The transform (m11, m12, m21, m22, dx, dy) method must multiply the current transformation matrix with the matrix described by −m11 ... Read More

Enable rear camera with HTML5

Samual Sam

Samual Sam

Updated on 25-Jun-2020 06:23:01

185 Views

To enable rear camera, firstly use −MediaStreamTrack.getSources(gotSources);Now, select the source and pass it in as optional into getUserMedia method.This method is useful for users to set permission to use up to one video input device −var a = {    audio: {       optional: [{sourceId: audioSource}]    }, ... Read More

Client-side image processing with HTML

Samual Sam

Samual Sam

Updated on 25-Jun-2020 05:58:37

293 Views

For client-side processing and uploading, you can try to run the following code −

How to render thin fonts more smoothly in CSS3 with HTML?

Samual Sam

Samual Sam

Updated on 25-Jun-2020 05:32:31

247 Views

To render thin fonts more smoothly, use −text-rendering: optimizeLegibility !important; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important;For Google Chrome, use −-webkit-font-smoothing:antialiased !important;You can enhance the performance like this −text-rendering: auto text-rendering: optimizeSpeed text-rendering: optimizeLegibility text-rendering: geometricPrecision text-rendering: inherit

Is there a way to add/remove several classes in one single instruction with classList in HTML and JavaScript?

Samual Sam

Samual Sam

Updated on 24-Jun-2020 14:13:58

96 Views

The classList property returns the class name(s) of an element, as a DOMTokenList object. The classList property is read-only, however, you can modify it by using the add() and remove() methods.The classListproperty ensures that duplicate classes are not unnecessarily added to the element. In order to keep this functionality, if ... Read More

How does mobile safari determine when to prompt the user to share location in HTML?

Samual Sam

Samual Sam

Updated on 24-Jun-2020 14:10:27

88 Views

When we have a requirement in which we want to track the latest locations for a user only when they are in a certain area, then we write separate code for it. The code to determine when to prompt the user to share location in HTML is as follows -if ... Read More

How to save DIV as Image with HTM5 canvas to image with the extension?

Samual Sam

Samual Sam

Updated on 24-Jun-2020 13:57:04

5K+ Views

DIV content can be saved as an image with the help of html2canvas() function in JavaScript. DIV tag defines a section in HTML document.Example      Welcome This shows the division area named cpimg.The html2canvas() function save div as an image with the following code −html2canvas(document.querySelector(“#cpimg”)).then(canvas  {         ... Read More

How to clear a chart from HTML5 canvas so that hover events cannot be triggered?

Samual Sam

Samual Sam

Updated on 24-Jun-2020 13:45:44

160 Views

To clear a chart from canvas, delete the element and then append a new element to the parent container as in the below-given code −var resetCanvas = function(){    $('#results-graph').remove();      $('#graph-container').append('');    canvas = document.querySelector('#results-graph');    ct = canvas.getContext('2d');    ct.canvas.width = $('#graph').width(); // here ... Read More

explode() function in PHP

Samual Sam

Samual Sam

Updated on 24-Jun-2020 13:28:14

252 Views

The explode() function is used to split a string by string.Syntaxexplode(delimiter, str, limit)Parametersdelimiter − The boundary stringstr − String to splitlimit − Specifies the number of array elements to return.The following are possible values −Greater than 0 - Returns an array with a maximum of limit element(s)Less than 0 - ... Read More

call_user_method_array() function in PHP

Samual Sam

Samual Sam

Updated on 24-Jun-2020 12:49:22

105 Views

The call_user_method_array() function call a user method given with an array of parameters.Note − The function is deprecated now.Syntaxcall_user_method_array(method, obj, params)Parametersmethod − Method nameobj − Object that method is being called on.params − Array of parametersAlternativeSince the call_user_method_array() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the ... Read More

Advertisements