.NET Framework Bookmark and Share   
 index > JScript for the .NET Framework > Screen Capture usig JavaScript
 

Screen Capture usig JavaScript

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 !

Emwsorthman

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 ActiveScreento 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

Citizen on the earth

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 ActiveScreento 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

Citizen on the earth
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
CMF0923
you need of dll for use the ActiveScreen
Muskus

You can use google to search for other answers

Custom Search

More Threads

• Problem with using dll with <object> in ASP.NET
• Activex create problem in vista/ie7-ie8
• memory leak in window.open() method
• ConfigurationManages namespace
• How do i get the MsScript control into my .net project?
• Eval and \
• How add date/week in JavaScript?
• am using asp.net why setTimeout not working for me, pls help
• Java script validations
• showModelessDialog Problem