通过jquery获取标签的图像,c# [英] get Image of tag by jquery,c#

查看:64
本文介绍了通过jquery获取标签的图像,c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取由jquery或c#选择的标签的图像。



示例:假设我有一个表tblMyTable,我想得到图像标题。



类似这样的$(#tblMyTable> tbody> tr:eq(0))。saveImage(path);

Is is possibe to get the images of the tag selected by jquery or c#.

example: Suppose I have a table tblMyTable , and I want to get image of header.

something like this $("#tblMyTable >tbody>tr:eq(0)").saveImage(path);

推荐答案

(#tblMyTable> tbody> tr:eq(0))。saveImage(path);
("#tblMyTable >tbody>tr:eq(0)").saveImage(path);


原样,JavaScript可以不能访问操作系统的存储(磁盘),所以你无法在那里保存任何东西。

您可以考虑这个:

1.将您需要的部分渲染到隐藏的画布中元素(需要html 5和带有画布支持的浏览器) - 请参见 https://developer.mozilla .org / zh-CN / docs / HTML / Canvas / Drawing_DOM_objects_into_a_canvas [ ^ ]

2.将canvas元素发送回服务器端并将其保存在那里。
As is, JavaScript can not access the the OS's storage (disk), so you can not save anything there.
You may consider this:
1. Render the part you need into a hidden canvas element (need html 5 and browser with canvas support) - see here how https://developer.mozilla.org/en-US/docs/HTML/Canvas/Drawing_DOM_objects_into_a_canvas[^]
2. Send the canvas element back to the server side and save it's content there.


这篇关于通过jquery获取标签的图像,c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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