Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI Everybody;
Provide some solution for solving this problem but i am able to save screenshot on local folder.
I am trying with this below code in Silvelight 4 in handler and wcf service.

C#
try
          {
              string filenamewithpath = string.Empty;
              filenamewithpath = HostingEnvironment.ApplicationPhysicalPath + "Images/Annotations/" + username + "/" + filename;

              string newDirectory = HostingEnvironment.ApplicationPhysicalPath + "Images/Annotations/" + username;
              this.CreateDirectoryIfNotExists(newDirectory);

              System.Drawing.Bitmap myImage = new System.Drawing.Bitmap(100, 100);
              //myImage.GetThumbnailImage(100, 100, null, new IntPtr());
              myImage = CaptureScreen.CaptureDesktopWithCursor(); //this is for getting screenshot.
              myImage.Save(filenamewithpath, System.Drawing.Imaging.ImageFormat.Png);

              System.Windows.Forms.MessageBox.Show("File Saved as " + filenamewithpath);
          }
          catch (Exception ex)
          {
              //this.ErrorLog(ex.Message);
          }
Posted
Updated 22-Jun-11 21:48pm
v2
Comments
AlokRSingh 20-Jul-11 5:36am    
Try to using these links.
http://www.codeproject.com/KB/aspnet/Website_URL_Screenshot.aspx
http://codegod.org/WebAppCodeGod/Screenshot-of-Webpage-with-ASP-NET-AID398.aspx

1 solution

Using CaptureDesktopWithCursor method it is not possible in the web application.
 
Share this answer
 
Comments
[no name] 27-Jul-11 7:06am    
Thanks Alok sir for replying..

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