Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

System.Windows.Drawing not working on server Environment (Windows 2008 and 2012 server) ?

$
0
0

HI All,

I am facing a problem from past few days on server environment. I have created the code for taking the screen shot of the windows as follow...This code is perfectly working in Run time environment. While running and debugging the application it is working fine. 

But once i configured this website on Windows server 2008 or Server 2012 it is not working it hangs out the application at the method graphics.CopyFromScreen().

I am unable to find out the solution for this from last few day's.  please help me to fix it. The code is as follow.

Bitmap bitmap = new Bitmap(600, 500);
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);  // The application hangs at this pt
graphics.CopyFromScreen(160, 235, 0, 0, bitmap.Size);
string mappath = Server.MapPath("~/dimurl/image/");
bitmap.Save(mappath + "myfile.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);

Please help me to resolve this.


Vaibhav Bhutkar, Jr. .Net Developer, Pune India.




Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>