All Projects → Banlangenn → vue-crop

Banlangenn / vue-crop

Licence: other
[举个例子]https://codesandbox.io/s/910ro8ym9r [演示链接(戳我直达)]http://www.wwwwxy.top/html/blg/

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-crop

react-simple-crop
✂️ A React component library for cropping and previewing images
Stars: ✭ 19 (-50%)
Mutual labels:  crop, crop-image
react-drop-n-crop
An opinionated implementation of react-dropzone and react-cropper
Stars: ✭ 17 (-55.26%)
Mutual labels:  crop, crop-image
React Easy Crop
A React component to crop images/videos with easy interactions
Stars: ✭ 1,093 (+2776.32%)
Mutual labels:  crop, crop-image
Croppy
Image Cropping Library for Android
Stars: ✭ 906 (+2284.21%)
Mutual labels:  crop, crop-image
React Cropper
Cropperjs as React component
Stars: ✭ 1,600 (+4110.53%)
Mutual labels:  crop, crop-image
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-23.68%)
Mutual labels:  crop, crop-image
Vue Croppie
Vue wrapper for croppie
Stars: ✭ 228 (+500%)
Mutual labels:  crop, crop-image
Tkimageview
An easy way to crop an image.
Stars: ✭ 342 (+800%)
Mutual labels:  crop, crop-image
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+3568.42%)
Mutual labels:  crop, crop-image
Vue Core Image Upload
a vue plugin for image to crop and upload
Stars: ✭ 1,321 (+3376.32%)
Mutual labels:  crop, vue-component
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+1905.26%)
Mutual labels:  crop, crop-image
Cropiwa
📐 Configurable Custom Crop widget for Android
Stars: ✭ 2,185 (+5650%)
Mutual labels:  crop, crop-image
Dragscalecircleview
a custom view that provides dragged and scaled
Stars: ✭ 513 (+1250%)
Mutual labels:  crop, crop-image
SSImagePicker
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Stars: ✭ 227 (+497.37%)
Mutual labels:  crop, crop-image
Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+10978.95%)
Mutual labels:  crop, crop-image
Svelte Easy Crop
A Svelte component to crop images with easy interactions
Stars: ✭ 80 (+110.53%)
Mutual labels:  crop, crop-image
pikaso
Seamless and headless HTML5 Canvas library
Stars: ✭ 23 (-39.47%)
Mutual labels:  crop, crop-image
crops
🌄 Image thumbnail generation server
Stars: ✭ 37 (-2.63%)
Mutual labels:  crop, crop-image
Svg Autocrop
🚗🌽🔳An NPM module to autocrop and slim down SVGs
Stars: ✭ 80 (+110.53%)
Mutual labels:  crop, crop-image
Krop
Small widget for image cropping in Instagram-like style
Stars: ✭ 107 (+181.58%)
Mutual labels:  crop, crop-image

vue-cropblg

vue 图片裁剪插件

演示链接(戳我直达)

Installation

$ npm install vue-cropblg
$ yarn add vue-cropblg

Usage

<template>
   <crop/>
   ...
</template>

组件内引入
import { crop } from "vue-cropblg";
 ...
components: {
  crop
},
 
全局引入
import crop from "vue-cropblg";
Vue.use(crop)

API

Attributes

参数 说明 类型 可选值 默认值
v-model 组件 Object -- --
shape 截图形状 String rect/arc/imgage rect
position 水印位置大小角度[x,y,size,angle] Array -- ['90%', '90%',1,0]
textWatermark 文字水印] String -- --
imageWatermark 图片水印 File / String -- --
defaultImgUrl 默认图片 File / String -- --
angle 按钮旋转角度 Number -- 0
color 水印.编辑框.控制按钮颜色 String 16进制颜色 反差最大颜色
rotation 图片在canvas旋转角度,能动态改变,rotateBtn为false有效 Number -- --
penBtn 是否渲染画笔按钮 Boolean true / false true
revokeBtn 是否渲染撤销按钮 Boolean true / false true
rotateBtn 是否渲染旋转按钮 Boolean true / false true

补充说明

画布中的图片是支持 单指拖动的,双指缩放的 (画笔激活状态下手势会被禁掉)

Methods

方法名 说明 参数
changeImage 改变处理图片,如果没有传imgAddress,会打开本地 Function(imgAddress: String)
getImage 获取处理后图片,返回Promise,可以选择返回 base64和bolb,quality为文件压缩比(大小) Function(type:Base64 / Bolb, mimeType:image/jpeg / image/png, quality:Number)
imgLoaded 图片canvas加载完成,对调用此函数(用来加loading) --

changeImage,getImage 是组件内置的:通过ref或v-model 调用

changeImage() 直接调用,默认会打开本地文件选择 ,changeImage('url') 传入图片 网络url 会编辑该链接图片
getImage() 2.直接调用:默认参数:getImage('Base64','image/png', 2) ,
type 可选值: Base64和 Bolb, mimeType 可选值:'image/jpeg' 和 'image/png', quality: 默认最佳

Slot

name 说明
placeholder 没有图片时占位图
defaultImgUrl 默认处理图片
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].