Avatar of Dein
Dein asked on

'Parameter is not valid' error when creating new Bitmap in webservice

When creating a new bitmap (new Bitmap(1600,1600)) in a .net webservice I get error: 'Parameter not valid'. Code is running fine when testing locally in VS2008, but when running on a server, it dosn't work. Sometimes I get an 'Out of memory' error in same statement, although theres 4 GB available...?
I have been digging a little into this and found this statement at the MSDN documentation for System.Drawing namespace: '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.'

If this is a fact, how will I then be able to create and draw bitmaps from a .net webservice?
.NET ProgrammingC#

Avatar of undefined
Last Comment

8/22/2022 - Mon

Well, you're still able to use third-party graphics libraries, like GD (with GD-sharp wrapper) or I'd look into WPF.

Hmm, that was not the anwer I was hoping for    :-(

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.