Class allready exists error

G

Guest

Hi!

I create a picturebox in my aspx-site (just to get the graphics object),
cause I want to draw a map and save it as a JPG using the Bitmap class.
Occasionally I get this error that confuses me:

Class allready exists
System.ComponentModel.Win32Exception

the code-line that causes this error is:
Graphics g = pb.CreateGraphics();

Usually I have to wait for a while and then when I try again it works. But
then it comes back again.

Any ideas?

/Miro
 
K

Kevin Spencer

Well, for a starter, you don't want to use ANY Windows Forms UI classes in
an ASP.Net app, and you don't have to. All you need is an Image or Bitmap,
and you can use the Graphics.FromImage() static method to get the graphics.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top