views:

48

answers:

3

Is it possible to take a screen capture of a particular area of a web-page from the web-page's own ASP.NET code?

I need to display 6 images that are stacked on top of one another using CSS, and I'd like to offer the user the ability to right-click save-as if possible by stacking the screen capture on top top of the original image stack.

Any thoughts?

Thanks

+2  A: 

Well it's not possible with ASP.NET to capture something the clients see. ASP.NET runs on the server, while CSS is client side.

You could maybe look into GDI+ and program the stack of images into an JPEG image.

But otherwise I think you're out of luck.

Hope this helps.

Eibx
I almost feel like there should be some way to render a portion of the page to a bitmap on the server side on page-load, but that feels like it would be hard to control, especially with ugly CSS that is stacking 6+ images... not to mention any javascript that the method would encounter
hamlin11
I can say with certainty, that you cannot get the HTML and CSS rendered. Once the HTML is passed to the clients, the clients is in charge of rendering the CSS. This means you need to implement a rendering engine, on your web server, in order to get the final product. I don't think anyone have ever done that. (:
Eibx
+1  A: 

There are tools allowing you to capture a screenshot of a webpage. These tools are not intended to be used in an ASP.NET environment. You cannot capture the contents of a page before the page has been rendered or within it (chicken and egg problem). You could have an external service which sends requests to the webpage and saves screenshots of it in time. Your webpage could then use these screenshots to display them to the user.

Darin Dimitrov
A: 

Use ActiveX control!

Rahul Soni