locked
Screen Capture usig JavaScript RRS feed

  • Question

  • I'm trying to code a ScreenCapture of a specific screen area from a Script. It seems as though I should be able to write JavaScript to do this using the Graphics.CopyFromScreen functionality of .NET, but I can't get this to work !

    Sunday, September 9, 2007 8:58 PM

Answers

  • Hi Emwsorthman,

     

    As I understand from your description, you would like to capture the screen of a specific area using javascript.

     

    You can try use an ActiveX control named ActiveScreen to capture the specific screen area as follows:

    1)Cature the whole screen and save to a jpg file
    var as=new ActiveXObject("ActiveScreen.Capturer");
    as.CaptureScreen();
    var fs=as.SaveToFile("test1.jpg");
    WScript.Echo("Image Size = " + fs.toString() + "\r\n");

     

    2)Cature a rectangle of the screen and save to a png file
    var as=new ActiveXObject("ActiveScreen.Capturer");
    as.CaptureRect(200, 200, 400, 300);
    var fs=as.SaveToFile("test3.png");
    WScript.Echo("Image Size = " + fs.toString() + "\r\n");

     

    Try to check out this article for details - http://www.xuebrothers.net/ax/activescreen/interfaces.htm

     

    Hope this helps,

     

    Regards,

    Citizens on the earth

     

    Monday, September 10, 2007 8:36 AM

All replies

  • Hi Emwsorthman,

     

    As I understand from your description, you would like to capture the screen of a specific area using javascript.

     

    You can try use an ActiveX control named ActiveScreen to capture the specific screen area as follows:

    1)Cature the whole screen and save to a jpg file
    var as=new ActiveXObject("ActiveScreen.Capturer");
    as.CaptureScreen();
    var fs=as.SaveToFile("test1.jpg");
    WScript.Echo("Image Size = " + fs.toString() + "\r\n");

     

    2)Cature a rectangle of the screen and save to a png file
    var as=new ActiveXObject("ActiveScreen.Capturer");
    as.CaptureRect(200, 200, 400, 300);
    var fs=as.SaveToFile("test3.png");
    WScript.Echo("Image Size = " + fs.toString() + "\r\n");

     

    Try to check out this article for details - http://www.xuebrothers.net/ax/activescreen/interfaces.htm

     

    Hope this helps,

     

    Regards,

    Citizens on the earth

     

    Monday, September 10, 2007 8:36 AM
  • It shows an error:
    A Runtime Error has occurred.
    Do you wish to Debug?

    Line:11
    Error:Automation server can't create object

    how can I resolve it?Thanks
    Friday, September 26, 2008 6:50 AM
  • you need of dll for use the ActiveScreen
    • Proposed as answer by mayurikava Thursday, July 28, 2011 1:30 PM
    Wednesday, July 1, 2009 6:54 PM