Groups | Blog | Home
all groups > dotnet drawing api > january 2006 >

dotnet drawing api : Dot Net 2.0 Restrictions???


JK
1/26/2006 2:18:02 PM
Is it true that from Dot Net 2.0 onwards >>
Classes within the System.Drawing namespace are not supported for use within
a Windows or ASP.NET service. Attempting to use these classes from within one
of these application types may produce unexpected problems, such as
diminished service performance and run-time exceptions.

And if that is the case then this sucks. We have applications that are
Windows service and perform image processing. So far we have not had issues
and if 2.0 has problems then we will not be able to migrate to it.

Please advise...

Thanks in Advance!
JK
1/26/2006 3:52:01 PM
From MSDN Web Site System.Drawing help at
http://msdn2.microsoft.com/en-us/library/xs6ftd89(en-US,VS.80).aspx


[quoted text, click to view]
Gerald Hernandez
1/26/2006 6:16:17 PM
Interesting.
I have no idea what problems this will create. However, I have some things
that I wanted to do in a service, but had been waiting for .NET 2.0 before I
started coding them. If this really does not work, then my plans are now
shot!

I suspect I desired to do something similar to what "JK" might want to do.
Basically, I had planned to use a service to generate graphics for my CAD
application and feed them down to a web browser and/or other client.

Gerald

[quoted text, click to view]

Lloyd Dupont
1/27/2006 12:00:00 AM
allright...
I would think that's just a new warning and that GDI+ is no less compatible
in 2.0 than it was in 1.0 & 1.1.
It's just that are some issues and they are warning people before hand.. I
assume..

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
[quoted text, click to view]

Lloyd Dupont
1/27/2006 12:00:00 AM
Where did you get this idea from?

[quoted text, click to view]

Shawn B.
1/27/2006 9:32:55 AM
[quoted text, click to view]

Well, if you think about it, everytime you use a chart control in your
asp.net application how do you think they are generating the graphics for
display? They're using GDI+ I'm certain, especially since they proudly
announce it is written in fully managed code... it must be System.Drawing.*.

True, it might impact performance. But even if you write the graphics
manipulation routines yourself in assembly language and call them from your
web application it is impacting performance... because it has to consume
clock cycles to do its thing. Its always going to be slower than if it
wasn't there in the first place. However, GD+ isn't hardware accelerated
like GDI was. Thus, everytime you call something in System.Drawing.* it is
actually using software logic and that is definately slower than if it was
hardware aceelerated (a la GDI classic) or if it wasn't there at all.

I wouldn't worry about it.

Thanks,
Shawn

James Westgate
1/27/2006 5:52:28 PM
System.Drawing/ GDI+ was designed to work in a user process on the
desktop, in a forms environment etc.

My feeling on this that System.drawing relies heavily on the graphics
object which in turns wraps a windows handle, and in that service
applications you may have reduced permissions, especially in upcoming
vista/ windows server products which may prevent some of these functions
working correctly...

Also creating 1 or more handles on a web site per session with many
users at the same time will cause problems, and so ms will add this
disclaimer to absolve themselves from having to deal with these
scalability issues.

Im sure all component vendors use gdi+ on some kind of handle to perform
processing like this for asp.net charting/diagramming components, but if
they are smart im sure they will use a singleton or thread pool solution
to handle graphics rendering.

If it keeps you awake at night you could look into the SVG standard
which creates graphics through xml markup, much like the new Windows
Presentation Framework classes will do, but its a lot of work and the
browser needs a plugin for it to work correctly.

James

www.crainiate.net


[quoted text, click to view]
Bob Powell [MVP]
1/30/2006 3:34:15 PM
I interpret that wording in the same way. I think that they are just warning
people that services are not well adapted to lengthy or memory intensive
operations. I'd go ahead as before I think.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



[quoted text, click to view]

AddThis Social Bookmark Button