Coder Social home page Coder Social logo

headimagecliper's Introduction

headImageCliper

本组件已停止更新,请使用功能更丰富的组件imageClipper

javascript头像裁剪上传组件,利用flash在本地进行裁剪后再上传,支持按尺寸预览头像,支持png、jpg、bmp、gif图片上传。

项目使用flashbuilder开发,可以用flashbuilder直接打开此项目。

demo

使用方法

1.把/bin-debug/headImageCliper.swf放到你的网站目录

2./demo文件夹下的所有图片和js放到你的网站目录。图片是swf文件需要使用的按钮、光标等,headImageCliper.js是与flash交互的组件HeadImageCliper。

3.使用如下代码调用裁剪组件:

window.imageCliper = new HeadImageCliper({
    container: container, //上传界面的容器,原生dom
    flashUrl: '../bin-debug/headImageCliper.swf?v=0527', //上传flash的地址,加上版本号,防止flash被缓存
    width: container.clientWidth, //flash的宽度
    height: container.clientHeight, //flash的高度
    uploadUrl: 'upload.php', //上传路径
    file: 'file', //上传的字段名,默认为file
    isPreview: true, //是否显示预览图
    previewSize: '180|100|50', //预览图尺寸。'200|100'代表显示200*200和100*100的预览图。注意预览图的尺寸如果过大,可能会超出flash的可视范围,此时应该设置不显示预览图或者增大flash的宽高度
    resourceUrl: 'http://127.0.0.1/headImageCliper/demo/' //flash包含的按钮、光标等静态文件的放置路径
});

完整示例请查看demo

有任何问题,mailto:[email protected]

headimagecliper's People

Contributors

libmw avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

headimagecliper's Issues

hi ,libmw

upload 的图片是框框框住的那点吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.