🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

canvaslayer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvaslayer

Canvas添加多个图层操作,支持单个图层的拖动、缩放、转转.Canvas adds multiple layers,Support single layer drag, zoom, rotation,Support android version 4.4+ and ios.

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
4
-75%
Maintainers
1
Weekly downloads
 
Created
Source

canvaslayer.js

This is an external method of jQuery,combines the functions of jcanvas.canvas adds multiple layers,Support single layer drag, zoom, rotation.Mainly for handheld mobile devices,commonly used in the addition of external multi-images in the canvas, the scaling threshold is between 0.1 and 5.Please be careful to the canvas own requirements and content limits when using.

  • There must be a jQuery dependency package in the module,or introduce a jQuery file in the html page script. version: jQuery 1.4 +.

  • In order to achieve good device compatibility, the js startup file can add the screen-pl requirement module.

  • System Support: Mobile browser kernel Android4.4+ 、ios ;Pc browser kernel webkit、Chrome、Gecko...

Install

npm install canvaslayer --save

Usage

Add the requirement JS library file to the code,Provide three parameters, and is a required argument [obj,imgname,imgsrc].obj is a jQuery canvas object,imgname is the unique name to add the image layer, and is a string type, imgsrc is the source to add the image layer and is a string type. rotation is also supported,default off, open need to add the fourth parameter boolean.

###JavaScript:


let canvaslayer= require('canvaslayer');

let cvs= $('canvas');

	canvaslayer(cvs,imgname,imgsrc);

###html:


<body>
	<canvas width="300" height="150"></canvas>
</body>

Keywords

Canvas

FAQs

Package last updated on 09 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts