在网页中保存图像 [英] saving image in the webpage

查看:89
本文介绍了在网页中保存图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想把2张图片叠加在一起。我隐藏第二张图片并显示第一张图片。保存图像时,我希望它保存隐藏的图像而不是显示的图像。



I am trying to put 2 images on top of each other. I am hiding the 2nd image and show the 1st image. when the image is saved, i want it to save the hidden image instead of the shown image.

<div style="width:180px;height:186px;">
<img src="1.jpg" width="180" height="186" alt="" style="z-index:-1;position:absolute;" />
<img src="2.gif" width="180" height="186" alt="My Kids"" style="z-index:-1;position:absolute; visibility:hidden" />
</div>





这可能吗?



谢谢



Is that possible?

Thanks

推荐答案

上下文菜单和将图像另存为条目属于浏览器,并且JavaScript中没有与之关联的事件,您可以处理和更改...

您可以更改整个上下文菜单,将其替换为您自己的菜单,但在这种情况下,您应该编写一些JavaScript来处理存储到磁盘的部分...但是JavaScript无法访问磁盘...

您可以在新窗口中打开正确的图像(要保存的图像),但在这种情况下,您将进行两步保存,即不太用户友好...

如果你做了所有这些有线'解决方案',你仍然不能阻止最终用户拍摄他想要的任何照片...

我会建议你考虑你的问题(也许与我们分享)单独的不同行,因为这和你以前的帖子真的无处可寻......
The context menu and the 'Save image as' entry in it belongs to the browser and there is no event associated to it in JavaScript, that you can handle and change...
You may change the whole context menu, by replacing it with your own, but in that case you should have to write some JavaScript to handle the save-to-disk part...but JavaScript can not access the disk...
You may open the right image (the one to save) in a new window, but in that case you are into a two-step saving, and that is not too user friendly...
And if you do all this wired 'solutions' you still can't prevent from end user to take whatever picture he wants...
I would advise you to think about your problem (and maybe share with us) alone different lines, as this and your previous post will lead nowhere really...


这篇关于在网页中保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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