开发者

Is it possible to fetch a rectangular section of a web-page as an image via JavaScript? [duplicate]

This question already has answers here: 开发者_StackOverflow Closed 11 years ago.

Possible Duplicate:

Take a screenshot of a webpage with javascript?

I'm developing an interactive HTML page and am looking for a way to capture an arbitrary portion of this page into a dataURI (Base64 encoded PNG).

I know its possible to get this for a canvas element but do modern browsers provide any way to do this for an arbitrary section of the page?


Not without sending it off server-side.

You could send an AJAX request to your server with some parameters (url, anchor, offset dimensions etc) and return a base64 string of the captured image.

Here's an example of capturing an image server-side using C#, there should be examples in other languages as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜