How to capture a screen shot in .NET from a webapplication?

Posted by CodeToGlory on Stack Overflow See other posts from Stack Overflow or by CodeToGlory
Published on 2010-05-26T19:33:47Z Indexed on 2010/05/26 20:21 UTC
Read the original article Hit count: 288

Filed under:
|

In Java we can do it as follows:

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;

...

public void captureScreen(String fileName) throws Exception {

   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   Rectangle screenRectangle = new Rectangle(screenSize);
   Robot robot = new Robot();
   BufferedImage image = robot.createScreenCapture(screenRectangle);
   ImageIO.write(image, "png", new File(fileName));

}

...

How do we do this in .NET from a webapplication? Capturing the client's screen and sending it to the server all from within the application.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET