How to capture screenshot in

Total Post:1


 4587  View(s)
Rate this:

Hi All,

 I am trying to take a Screen shot of the client Screen[they are allowed to draw a diagram,when they click save ,it should get saved as Image in database.

Also the user should be able to see it again] . After searching for 2 week ,i implemented the below code in [windows xp,,C#,SQL]

develpment machine and it works fine. When i deployed the app in Server ,then the problem started.When the Save button is clicked it gave

  System.ComponentModel.Win32Exception: The handle is invalid
[Win32Exception (0x80004005): The handle is invalid]

System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation) +542 Default3.ThreadMethod() +225

Below is the code

Rectangle bounds = new Rectangle(620, 370, Convert.ToInt32(Panel1.Width.Value) - 20, Convert.ToInt32(Panel1.Height.Value) - 10); using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size); } bitmap.Save(Server.MapPath("~") + "\\ScreenShot\\" + Request.QueryString["TrafficID"].ToString() + ".JPEG", ImageFormat.Jpeg); } Thanks,
  1. Re: How to capture screenshot in

    Hey Why you want to implement it client side? and If you are going to take screenshot then how you going to save in the database? We can implement it easily by using windows service but I am not sure about client side..
    and also you will not have any idea about client operating system might be difficult ...
    see if you can find something in sliverlight...
    Good Luck!!


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.