I. Methods of Use
The HTML structure of the canvas plugin is very simple, which is to use a tag:
You can then invoke the plug-in using the following method:
function init () {
document.getElementById (' Portrait-image '). Closepixelate ([
{resolution:24},
{shape: ' Circle ', resolution:24, Size:16, Offset:12, alpha:0.5}
]);
};
Window.addeventlistener (' Load ', init, false);
Second, the structure function and the method
var Img=document.getelementbyid (' portrait-img ');
var mypixelation=new closepixelation (img, [{resolution:24}]);
Mypixelation.render ([
{resolution:32},
{resolution:16, Shape: ' Circle ', offset:8}
]);
Mypixelation.renderclosepixels ({
resolution:48, alpha:0.5
});
Keymob Mobile advertising platform will integrate domestic and foreign mainstream mobile advertising platform, and the unified management of advertising functions, dynamic configuration, advertisers and developers can easily through the simple operation of a number of advertising platforms with the use of.
HTML5 add canvas to create a mosaic-effect JS Plugin tutorial