npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vueshapeimg

v1.4.5

Published

Picture clipping component made with vue. vue编写的图片裁剪组件

Downloads

162

Readme

vueShapeImg

install size Codacy Badge

Picture clipping component made with vue. vue编写的图片裁剪组件

If you like, please give me a star (๑•̀ㅂ•́)و✧

如果你喜欢它,可以给我星星吗 (๑•̀ㅂ•́)و✧

Demonstration

English 中文文档

OnlineDemo

How to use

import vueShapeImg from 'vueshapeimg'
Vue.use(vueShapeImg)

<vue-shape-img></vue-shape-img>

vueShapeImg API Doc

props

|Parameters|Description|Type|Optional values|Default value| |----------|--------|----------|----------|----------| |useFrame|Clipping pictures using marquee boxes|Boolean|Y|false| |canResizeFrame|Whether the box can be scaled and moved|Boolean|Y|true| |initRange|Left,Top,Width and Height of box initialization|Array|Y|[width*0.25,height*0.25,width*0.5,height*0.5]| |height|-|Number|Y|500| |width|-|Number|Y|500| |timelyGetRange|Timely get user's select range|Boolean|Y|false| |timelyImageData|Timely converting pictures that capture the user's range of choice into imageData|Boolean|Y|false| |aspectRatio|Keeping aspect ratio scaling clipping frame|Boolean|Y|false| |disableResize|Forbidding scaling clipping frame|Boolean|Y|false|

tips: You can't use imageData directly,show it in canvas putImageData

methods

|Method name|Description|Parameters| |----------|--------|----------| |rotate|Rotate the picture on canvas|deg(Arbitrary integer)| |setImgSrc|Use network picture. Pictures with different domain names are best not to be used|imgSrc(Picture links or Base64 files)| |fileClick|Use local picture|-| |showMask|Open the mask layer, select the area|-| |closeMask|Close the mask layer|-| |getRange|Get the scope of user selection|-| |setRange|Set the scope of user selection|[left,top,width,height]| |getImg|Get pictures of the range selected by the user|type('base64'/'blob'), imgType('image/jpeg' Or other image types),encoderOptions(0.00 - 1.00)|

tips: getImg -> imgType -> 'image/jpeg' can compress pictures better

emit

|emit name|Description |----------|--------| |imageDataChange|if props timelyImageData is true, this emit can return the imageData in timely| |rangeChange|if props timelyGetRange is true, this emit can return the range in timely| |error|error tips: -1(Picture format error), -2(Picture loading failed), -3(Pictures are cross-domain resources)|

tips: You can not use imageData directly,show it in canvas putImageData

Example OnlineDemo

Browser support

IE10+, chrome, firefox or other modern Browser

Upgraded content

1.4.5 (2019-6-26 15:16:00)

Added the function of keeping aspect ratio scaling clipping frame and forbidding scaling clipping frame.

1.4.3 (2019-6-24 17:30:44)

Repairing drag problem in clipping frame zooming

1.4.1 (2019-5-24 09:41:00)

Fixed the problem of dragging the whole canvas when the mouseup event was triggered on the clipping box when moving the picture in the frame mode in IE browser.

1.3.4 (2019-5-15 15:17:51)

Limit the range of input parameters of setRange function

1.3.2 (2019-5-15 11:23:55)

Fixed the problem of calling the rotate function picture to return to the center of the canvas after moving the picture in frame mode

more version info