当我点击“保存”时该特定图像将下载到桌面 [英] when i click the "save" that particular image will be download to desktop

查看:79
本文介绍了当我点击“保存”时该特定图像将下载到桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< div id =rightoutputimgae>

< div id =rightimgIdclass =rightimg =tooltipcontent =< img src ='jqe13 / image / 1.jpg'class ='tooltip-image'/>>

< div id =outputimageIdclass =outputimage>< img src =jqe13 / image / 1.jpgalt =右下图像>< / div>

< / div>

< ul>< li id = outcheckbox>< input name =outChecktype =checkbox>< / li>

< li id =outedit>< a href =# >< img src =jqe13 / image / edit_s.PNGalt =edittitle =编辑>< / a>< / li>

< li id =outdelete>< a href =#>< img src =jqe13 / image / delet_c.PNGalt =deletetitle =Delete>< / a>< / li>

< li id =outfullscreen>< a href =#>< img src =jqe13 / image / fullscreen_c.PNGalt =全屏class =fullscreentitle =全屏>< / a>< / li>

< li id =outshare>< a href =# >< img src =jqe13 / image / share_c .PNGalt =分享title =分享>< / a>

< div id =menu>

< div id =tooltip_menu>

< a href =#class =menu_topid =email>< img src =jqe13 / image / email.PNGalt = Emailtitle =Email>< / a>

< a href =#onClick =postToFeed()class =facebook>< img src = jqe13 / image / fb.PNGalt =Facebooktitle =Facebook>< / a>

< a href =#id =twitter>< ; img src =jqe13 / image / twitter.pngalt =Twittertitle =Twitter>< / a>

< a href =#class =menu_bottom id =save>< img src =jqe13 / image / save.PNGalt =保存title =保存>< / a>

< / div>

< / div>

< / li>

< li id =outprint>< a href =#class =printMe>< img src =jqe13 / image / print.PNGalt =Printtitle =Print>< / a>< / li>

< / ul>

< / div>






我的qus是,,,我用一些项目动态创建了图像...我想当我点击保存时直接使用HTML5 canvas和Jquery将该特定图像下载到客户端桌面。

i我正在使用image2canvas.js文件将图像绘制到画布......

i获取图像ID,并将其转换为画布。



$(#save)。live('click',function()

{

var sectionId = $(这个).parents('ul')。attr('id');

var outputId = sectionId.replace('ul','img');

console .log(sectionId);

console.log(outputId);



var imgTarget = $('#'+ outputId).image2canvas ();

});

这里我得到的是我动态创建的图像它放在div id =rightoutputimgae...点击保存它转换画布在同一个地方....意味着原始图像转换。将被转换成一些隐藏的画布而不影响原始图像

&我想将带有图像的画布............下载到桌面..... <单击保存,转换和下载后,将完成整个过程...



plz任何人帮助我.............

<div id="rightoutputimgae">
<div id="rightimgId" class="rightimg" rel="tooltip" content="<img src='jqe13/image/1.jpg' class='tooltip-image'/> ">
<div id="outputimageId" class="outputimage"><img src="jqe13/image/1.jpg" alt="Right Bottom Image"></div>
</div>
<ul><li id="outcheckbox"><input name="outCheck" type="checkbox"></li>
<li id="outedit"><a href="#"><img src="jqe13/image/edit_s.PNG" alt="edit" title="Edit"></a></li>
<li id="outdelete"><a href="#"><img src="jqe13/image/delet_c.PNG" alt="delete" title="Delete"></a></li>
<li id="outfullscreen"><a href="#"><img src="jqe13/image/fullscreen_c.PNG" alt="Full Screen" class="fullscreen" title="Full Screen"></a></li>
<li id="outshare"><a href="#"><img src="jqe13/image/share_c.PNG" alt="Share" title="Share"></a>
<div id="menu">
<div id="tooltip_menu">
<a href="#" class="menu_top" id="email"><img src="jqe13/image/email.PNG" alt="Email" title="Email"></a>
<a href="#" onClick="postToFeed()" class="facebook"><img src="jqe13/image/fb.PNG" alt="Facebook" title="Facebook"></a>
<a href="#" id="twitter"><img src="jqe13/image/twitter.png" alt="Twitter" title="Twitter"></a>
<a href="#" class="menu_bottom" id="save"><img src="jqe13/image/save.PNG" alt="Save" title="Save"></a>
</div>
</div>
</li>
<li id="outprint"><a href="#" class="printMe"><img src="jqe13/image/print.PNG" alt="Print" title="Print"></a></li>
</ul>
</div>



My qus is ,,,i have created image dynamically with some items...i want when i click on "save" directly download that particular image to client desktop using HTML5 canvas & Jquery.
i am using image2canvas.js file to draw a image to canvas......
i get the image Id like this and converted into canvas.

$("#save").live('click', function()
{
var sectionId = $(this).parents('ul').attr('id');
var outputId = sectionId.replace('ul','img');
console.log(sectionId);
console.log(outputId);

var imgTarget = $('#'+outputId).image2canvas();
});
here what i getting is i created image dynamically it placed in div id= "rightoutputimgae" ...click on "save" its converted to canvas at same place....means original image converted. that will be converted into some hidden canvas not affected the original image
& i want to download that canvas with image ............into desktop .....

total process will be done when click the "save" ,conversion and download...

plz any one help me.............

推荐答案

(#save)。live('click',function()

{

var sectionId =
("#save").live('click', function()
{
var sectionId =


(this).parents('ul')。attr('id');

var outputId = sectionId.replace('ul','img');

console.log(sectionId);

console.log( outputId);



var imgTarget =
(this).parents('ul').attr('id');
var outputId = sectionId.replace('ul','img');
console.log(sectionId);
console.log(outputId);

var imgTarget =


('#'+ outputId).image2canvas();

});

这里我得到的是我创建的图像动态它放在div id =rightoutputimgae...点击保存它转换到画布在同一个地方... .means original i法师转换。将被转换成一些隐藏的画布而不影响原始图像

&我想将带有图像的画布............下载到桌面..... <单击保存,转换和下载后,将完成整个过程...



plz任何人帮助我.............
('#'+outputId).image2canvas();
});
here what i getting is i created image dynamically it placed in div id= "rightoutputimgae" ...click on "save" its converted to canvas at same place....means original image converted. that will be converted into some hidden canvas not affected the original image
& i want to download that canvas with image ............into desktop .....

total process will be done when click the "save" ,conversion and download...

plz any one help me.............


这篇关于当我点击“保存”时该特定图像将下载到桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆