Drawing with GDI+ under IIS
I'm running a web application under IIS that we draw graphs with that are sent to the clients. We were previously running under iis6, while migrating to 2008 ( iis7 ) we have encountered some very weird issues with the graphing. I stumbled across the msdn docs for GDI+ stating that "GDI+ functi开发者_开发知识库ons and classes are not supported for use within a Windows service." I suspect that my issues are probably related to further isolation of services http://msdn.microsoft.com/en-us/library/ms533798%28VS.85%29.aspx
My question is how the heck are we supposed to draw graphics? Raw GDI? OpenGL - but doesn't that still require a DC?
I had asked a similar question:
Why not use GDI+ from ASP.NET
I ended up switching to the LeadTools libraries.
Of course, you can choose any library that is not device dependent. GDI+ is depending on a device context which gives it a physical device to base it's graphics on. However, when running as a service, the graphics adapter is probably not available for use as it would be in a desktop environment.
You could also write your own graphics routines which draw to a bitmap. A bitmap is simply raw memory arranged in a certain format.
Not 100% on your particular situation given the details; but why not perform your graphics rendering with a simple asp.net application? You can use the System.Drawing namespace which wraps GDI+
If you need just barebones functionality for rendering graphics and delivering to clients over HTTP, you can also use an HTTPHandler
精彩评论