在线编辑图片(转)
2015-08-18 12:58
344 查看
阅读目录
1效果图
2实现
3参数介绍
4官方文档
一个免费的图片编辑SDK,可用于web,ios,android平台。本文主要介绍web端使用方法。
回到顶部
回到顶部
作者:疯吻IT出处:http://fengwenit.cnblogs.com
回到顶部
https://creativesdk.adobe.com/docs/web/#/index.html
所有工具如下:
默认en为英语
//alert(newURL);
$.ajax({
url:"ashx/CarInfo.ashx?type=DownloadCarPhoto&imgUrl="+newURL+"&rand="+Math.random(),
success:function(url){
alert('保存成功');
varimg=document.getElementById(imageID);
img.src=url;
},
error:function(){
alert('error')
}
});
},
回到顶部
https://creativesdk.adobe.com/docs/web/#/index.html
在线系列
/article/4907209.html
一个免费的图片编辑SDK,可用于web,ios,android平台。本文主要介绍web端使用方法。
1效果图
点击“EditPhoto”按钮,查看效果图2实现
复制下面代码,保存为html文件<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
<title>图片编辑</title>
<scriptsrc="https://code.jquery.com/jquery-1.7.2.js"></script>
<scriptsrc="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
<scripttype='text/javascript'>
//在线编辑图片功能,第三方插件,完全免费
varfeatherEditor=newAviary.Feather({
apiKey:'121285904@qq.com',//apikey可以免费申请,https://creativesdk.adobe.com/docs/web/#/index.html
apiVersion:3,
theme:'dark',//Checkoutournew'light'and'dark'themes!
tools:'all',//这里设置为all,可以显示所有的工具
initTool:'text',//默认展开的工具
language:'zh_HANS',//简体中文
appendTo:'',
onSave:function(imageID,newURL){
//alert(newURL);
$.ajax({
url:"ashx/CarInfo.ashx?type=DownloadCarPhoto&imgUrl="+newURL+"&rand="+Math.random(),
success:function(url){
alert('保存成功');
varimg=document.getElementById(imageID);
img.src=url;
},
error:function(){
alert('error')
}
});
},
onError:function(errorObj){
alert(errorObj.message);
}
});
functionlaunchEditor(id,src){
featherEditor.launch({
image:id,
url:src
});
returnfalse;
}
</script>
</head>
<body>
<formid="form1"runat="server">
<divid='injection_site'></div>
<imgid='image1'src='https://img.alicdn.com/imgextra/i2/62935302/TB2hBzSeXXXXXbMXXXXXXXXXXXX_!!62935302.jpg'/>
<!--Addaneditbutton,passingtheHTMLidoftheimageandthepublicURLoftheimage-->
<p><inputtype='image'src=''value='Editphoto'onclick="returnlaunchEditor('image1','https://img.alicdn.com/imgextra/i2/62935302/TB2hBzSeXXXXXbMXXXXXXXXXXXX_!!62935302.jpg');"/></p>
</form>
</body>
</html>
作者:
3参数介绍
apiKey
必须,apikey可以免费申请,所有的工具
tools:'text,resize',//这里设置为all,可以显示所有的工具;如果只想显示部份工具,可以用逗号分隔所有工具如下:
enhance:Autocorrectyourphotowithoneoffivebasicenhancements.
effects:Choosefromavarietyofeffectsandfiltersforyourphoto.
frames:Choosefromavarietyofframestoapplyaroundyourphoto.
overlays:Choosefromavarietyofoverlaystoapplyoveryourphoto.
stickers:Choosefromavarietyofstickersyoucanresizeandplaceonyourphoto.
orientation:Rotateandflipyourphotoinonetool.
crop:Cropaportionofyourphoto.AddpresetsviaAPI.Fixed-pixel
cropPresetsperforma
resizewhenapplied.
resize:Resizetheimageusingwidthandheightnumberfields.
lighting:Adjustthelightinginyourphotowiththiscollectionofadjustmenttoools.
color:Adjustthecolorinyourphotowiththiscollectionofadjustmenttoools.
sharpness:Blurorsharpentheoverallimageinonetool.
focus:Addsaselectivelinearorradialfocustoyourphoto.
vignette:Addsanadjustablevignettetoyourphoto.
blemish:Removeskinblemisheswithabrush.
whiten:Whitenteethwithabrush.
redeye:Removeredeyefromyourphotowithabrush.
draw:Adddoodleoverlayswithabrush.
colorsplash:Useasmartbrushtocolorizepartsofyourphotowhichbecomesgrayscaleotherwise.
text:Addcustom,resizabletext.
meme:Turnyourphotointoamemewiththistoolthataddstexttothetopandbottomofyourphoto.
默认展开的工具
initTool:'text',//默认展开的工具语言
language:'zh_HANS',//简体中文默认en为英语
保存
onSave:function(imageID,newURL){//alert(newURL);
$.ajax({
url:"ashx/CarInfo.ashx?type=DownloadCarPhoto&imgUrl="+newURL+"&rand="+Math.random(),
success:function(url){
alert('保存成功');
varimg=document.getElementById(imageID);
img.src=url;
},
error:function(){
alert('error')
}
});
},
4官方文档
相关文章推荐
- 每当在测试之路迷茫的时候来看看这篇文章
- 如何解决inline-block元素的空白间距 css 完美解决
- 【转载】【milk】This is the code that I use for my research projects.
- Java技术1-线程池
- Java虚拟机垃圾回收过程
- PAT 1096. Consecutive Factors (20)
- 网上搜集的一段php可逆加密函数
- 浅析pinyin4j源码 简单利用pinyin4j对中文字符进行自然排序(转)
- Flickr Architecture
- codeforces - 3C - Tic-tac-toe
- 开发Android硬件访问服务
- Rust初步(一):介绍
- 经典排序算法1--冒泡排序
- 我的高中时代──纪念1995年进入高中20周年
- 发两张学院的100元优惠券,满300可用
- iOS 8 毛玻璃效果(模糊)
- 基于java的挖地雷游戏
- Android源码分析之Handler机制
- 泛型(java基础)
- UI笔记:UILabel、UIButton和UITextField