tags:

views:

188

answers:

1

Hi all,

I am sending an ajax request on dblick for creating the image of the screen where it is double clicked.I am ising imagegrabscreen() function of PHP to create image but instead of creating its image it is creates a black image.

dblclick(function (ev,ui)
                {
                var response = $.ajax({
                type:"POST",
                url: "grabImage.php",
                data:"name=John&location=Boston&function_name=img",
                complete: function(msg){
                    var resp = msg.responseText;
                    if(msg && msg.readyState != 4) { alert("Ready State :"+msg.readyState); return;  }
                    else{
                        //wb_load();
                        alert( "Data Saved: " + resp);

                }
                }
     });

                }
            );

GRAB IMAGE FUNCTION

function img()
    {
    $im = imagegrabscreen();
    imagepng($im, "C:\myscreenshot.png");
    //echo $im;
    //imagedestroy($im);
    return $im;
    define('imge',$im);
    }
A: 

http://us.php.net/manual/en/function.imagegrabscreen.php

For this to work your Apache service must be set to 'Allow service to interact with desktop' otherwise you will just get a blank image. To fix this right-click My Computer, select Manage/Services and Applications/Services - find the apache service (like Apache2) and right-click, select Properties - choose the Log on tab and check the 'Allow service to interact with desktop' checkbox. Restart Apache.

Mr. Smith
I am using XAMPP.I hope that won't make any effect.I did what u told me to do bt its not working.Same blabk image is formed
http://stackoverflow.com/questions/631449/getting-imagegrabscreen-to-work
Mr. Smith