Click here to Skip to main content
16,009,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This s the code i had written to capture a screen(a tablegoogle map) but it is getting no value in var activeX and showing error "null is a null object"...Is there any solution?

C#
function CaptureScreen() {
                try {

                    var activeX = new ActiveXObject("ActiveX.ExeActivator");

          document.parentWindow.moveTo(0, 0);
                    document.parentWindow.resizeTo(document.parentWindow.screen.width, document.parentWindow.screen.height);

                    var table = document.getElementById("tblGoogleMap");


                    var x = document.parentWindow.screenLeft + table.getClientRects()[0].left;
                    var y = document.parentWindow.screenTop + table.getClientRects()[0].top;
                    var width = table.offsetWidth;
                    var height = table.offsetHeight;


//                    //var activeX = new ActiveXObject("ScreenCaptureActiveX.ScreenCapture");
//                    //                            activeX.CaptureScreen(x, y, width, height);




                }

                catch (ex) {
                    if (ex.message == "Automation server can't create object") {

                       $find("mpInstallActivex").show();
                   }
                    else {

                        alert("Message : " + ex.message + " Description : " + ex.description);
                    }
                }
            }
Posted
Updated 10-Jan-12 0:40am
v2

 
Share this answer
 
Thanks to you i found a solution for c# screen capture.Go to TeboScreen: Basic C# Screen Capture Application to see the article.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900